]> code.citadel.org Git - citadel.git/blobdiff - citadel/debian/citadel-common.postinst
* create user and directories needed in common package.
[citadel.git] / citadel / debian / citadel-common.postinst
diff --git a/citadel/debian/citadel-common.postinst b/citadel/debian/citadel-common.postinst
new file mode 100644 (file)
index 0000000..37c560c
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/sh
+# postinst script for citadel-server
+set -e
+
+# source debconf stuff
+. /usr/share/debconf/confmodule
+db_version 2.0
+
+case "$1" in
+    configure)
+        if ! getent group citadel >/dev/null; then 
+            groupadd citadel
+        fi
+
+        if ! getent passwd citadel >/dev/null; then 
+            adduser --system --ingroup citadel --home /var/lib/citadel \
+                    --gecos "Citadel system user" --shell /bin/sh \
+                    --disabled-password citadel
+        fi
+
+        chown -R citadel:citadel /etc/citadel
+    ;;
+
+    abort-upgrade|abort-remove|abort-deconfigure)
+    ;;
+
+    *)
+        echo "postinst called with unknown argument \`$1'" >&2
+        exit 1
+    ;;
+esac
+
+#DEBHELPER#
+
+exit 0