* create user and directories needed in common package.
authorWilfried Göesgens <willi@citadel.org>
Tue, 23 Jan 2007 20:09:50 +0000 (20:09 +0000)
committerWilfried Göesgens <willi@citadel.org>
Tue, 23 Jan 2007 20:09:50 +0000 (20:09 +0000)
citadel/debian/citadel-common.dirs [new file with mode: 0644]
citadel/debian/citadel-common.postinst [new file with mode: 0644]

diff --git a/citadel/debian/citadel-common.dirs b/citadel/debian/citadel-common.dirs
new file mode 100644 (file)
index 0000000..3488215
--- /dev/null
@@ -0,0 +1 @@
+etc/citadel
\ No newline at end of file
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