sync-httpd.postinst (1216B)
1 #!/bin/bash 2 3 set -e 4 5 if [ -d /run/systemd/system ]; then 6 systemctl --system daemon-reload >/dev/null || true 7 fi 8 if [ "$1" = "remove" ]; then 9 if [ -x "/usr/bin/deb-systemd-helper" ]; then 10 deb-systemd-helper mask 'sync-httpd.service' >/dev/null || true 11 fi 12 fi 13 14 if [ "$1" = "purge" ]; then 15 if [ -x "/usr/bin/deb-systemd-helper" ]; then 16 deb-systemd-helper purge 'sync-httpd.service' >/dev/null || true 17 deb-systemd-helper unmask 'sync-httpd.service' >/dev/null || true 18 fi 19 fi 20 21 SYNC_HOME="/var/lib/sync/" 22 23 . /usr/share/debconf/confmodule 24 25 case "${1}" in 26 configure) 27 # Creating taler users if needed 28 if ! getent passwd sync-httpd >/dev/null; 29 then 30 adduser --quiet --system --ingroup www-data --no-create-home --home ${SYNC_HOME} sync-httpd 31 fi 32 33 if ! dpkg-statoverride --list /etc/sync/secrets/sync-db.secret.conf >/dev/null 2>&1; 34 then 35 dpkg-statoverride --add --update \ 36 sync-httpd root 640 \ 37 /etc/sync/secrets/sync-db.secret.conf 38 fi 39 ;; 40 41 abort-upgrade | abort-remove | abort-deconfigure) ;; 42 43 *) 44 echo "postinst called with unknown argument \`${1}'" >&2 45 exit 1 46 ;; 47 esac 48 49 #DEBHELPER# 50 51 exit 0