summarylogtreecommitdiffstats
path: root/courier-authlib.install
diff options
context:
space:
mode:
Diffstat (limited to 'courier-authlib.install')
-rw-r--r--courier-authlib.install27
1 files changed, 27 insertions, 0 deletions
diff --git a/courier-authlib.install b/courier-authlib.install
new file mode 100644
index 000000000000..54fc631b10cf
--- /dev/null
+++ b/courier-authlib.install
@@ -0,0 +1,27 @@
+# arg 1: the new package version
+post_install() {
+ # creates group and user on virgin systems
+ if ! getent group courier >/dev/null; then
+ groupadd -g 72 courier >/dev/null 2>&1
+ fi
+
+ if getent passwd courier >/dev/null; then
+ useradd -u 72 -d /var/spool/courier -g courier -s /bin/false courier >/dev/null 2>&1
+ fi
+
+ useradd courier -g courier
+ systemd-tmpfiles --create /usr/lib/tmpfiles.d/courier-authlib.conf
+}
+
+# arg 1: the new package version
+# arg 2: the old package version
+post_upgrade() {
+ post_install $1
+}
+
+# arg 1: the old package version
+pre_remove() {
+ userdel courier
+ groupdel courier
+} >/dev/null 2>&1
+