summaryrefslogtreecommitdiff
path: root/debian/bigcouch.postinst
diff options
context:
space:
mode:
Diffstat (limited to 'debian/bigcouch.postinst')
-rw-r--r--debian/bigcouch.postinst26
1 files changed, 26 insertions, 0 deletions
diff --git a/debian/bigcouch.postinst b/debian/bigcouch.postinst
new file mode 100644
index 00000000..59f9d86e
--- /dev/null
+++ b/debian/bigcouch.postinst
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+
+case $1 in
+ configure)
+ if ! getent passwd bigcouch > /dev/null; then
+ adduser --system --quiet --home /home/bigcouch \
+ --shell /bin/bash --group bigcouch
+ fi
+ if test "`id -u bigcouch`" -eq 0; then
+ echo "The bigcouch administrative user must not be root." >&2
+ false
+ fi
+ if test "`id -g bigcouch`" -eq 0; then
+ echo "The bigcouch administrative group must not be root." >&2
+ false
+ fi
+ chown -R bigcouch:bigcouch /opt/bigcouch
+ mkdir -p /home/bigcouch
+ chown -R bigcouch:bigcouch /home/bigcouch
+ chown -R bigcouch:bigcouch /opt/bigcouch
+ chown -R root:root /etc/sv/bigcouch
+ ln -sf /etc/sv/bigcouch /etc/service/
+ ;;
+esac
+
+#DEBHELPER#