aboutsummaryrefslogtreecommitdiff
path: root/debian/postinst
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2021-01-07 20:52:38 -0500
committerB Stack <bgstack15@gmail.com>2021-01-07 20:56:10 -0500
commitbadcb48cd279f0e2a0ed7eae2661171f2411e647 (patch)
tree920d3319404ece4811fd7f8bea5ef96ba52021e1 /debian/postinst
downloadfuss-badcb48cd279f0e2a0ed7eae2661171f2411e647.tar.gz
fuss-badcb48cd279f0e2a0ed7eae2661171f2411e647.tar.bz2
fuss-badcb48cd279f0e2a0ed7eae2661171f2411e647.zip
initial commit
Diffstat (limited to 'debian/postinst')
-rw-r--r--debian/postinst36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..9c80e67
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,36 @@
+#!/bin/sh
+set -e
+
+#DEBHELPER#
+
+OUT=/dev/null
+USERNAME=fuss
+HOME=/var/www/fuss
+SERVICE=fuss
+
+case "$1" in
+ configure)
+ update-rc.d ${SERVICE} defaults
+ if ! getent passwd ${USERNAME} 1>${OUT} 2>&1 ;
+ then
+ echo "Creating ${USERNAME} system user & group..."
+ adduser --quiet --system --home $HOME \
+ --disabled-password --group \
+ --gecos "FUSS system user" \
+ ${USERNAME} > ${OUT} 2>&1
+ fi
+ chown ${USERNAME}:${USERNAME} \
+ ${HOME} ${HOME}/* \
+ /var/log/${SERVICE} /var/log/${SERVICE}/*log 1>/${OUT} 2>&1 || :
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+exit 0
bgstack15