sync

Backup service to store encrypted wallet databases (experimental)
Log | Files | Refs | Submodules | README | LICENSE

sync-httpd.postinst (1462B)


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