challenger-httpd.postinst (1340B)
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 'challenger-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 'challenger-httpd.service' >/dev/null || true 17 deb-systemd-helper unmask 'challenger-httpd.service' >/dev/null || true 18 fi 19 fi 20 21 CHALLENGER_HOME="/var/lib/challenger/" 22 23 . /usr/share/debconf/confmodule 24 25 case "${1}" in 26 configure) 27 # Creating taler users if needed 28 if ! getent passwd challenger-httpd >/dev/null 29 then 30 adduser --quiet --system --ingroup www-data --no-create-home --home ${CHALLENGER_HOME} challenger-httpd 31 fi 32 33 # Try to generate compressed versions of the SPA 34 for n in index.css index.js main.css index.html 35 do 36 TDIR="/usr/share/challenger/" 37 gzip --best - < "${TDIR}/spa/$n" > "${TDIR}/spa/$n.gz" || true 38 zstd -19 - < "${TDIR}/spa/$n" > "${TDIR}/spa/$n.zstd" || true 39 done 40 ;; 41 42 abort-upgrade | abort-remove | abort-deconfigure) ;; 43 44 *) 45 echo "postinst called with unknown argument \`${1}'" >&2 46 exit 1 47 ;; 48 esac 49 50 #DEBHELPER# 51 52 exit 0