"Fossies" - the Fresh Open Source Software Archive

Member "install/doinst.sh" (9 Feb 2022, 2739 Bytes) of package /linux/privat/benno-smtp-2.8.0.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "doinst.sh": 2.6.0_vs_2.8.0.

    1 #!/bin/sh
    2 # postinst script for benno-archive
    3 #
    4 # see: dh_installdeb(1)
    5 
    6 set -e
    7 
    8 # summary of how this script can be called:
    9 #        * <postinst> `configure' <most-recently-configured-version>
   10 #        * <old-postinst> `abort-upgrade' <new version>
   11 #        * <conflictor's-postinst> `abort-remove' `in-favour' <package>
   12 #          <new-version>
   13 #        * <postinst> `abort-remove'
   14 #        * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
   15 #          <failed-install-package> <version> `removing'
   16 #          <conflicting-package> <version>
   17 # for details, see http://www.debian.org/doc/debian-policy/ or
   18 # the debian-policy package
   19 
   20 
   21 case "$1" in
   22     configure)
   23     ;;
   24 
   25     abort-upgrade|abort-remove|abort-deconfigure)
   26     ;;
   27 
   28     *)
   29         echo "postinst called with unknown argument \`$1'" >&2
   30         exit 1
   31     ;;
   32 esac
   33 
   34 set +e
   35 chown --silent benno.benno /var/log/benno
   36 chown --silent benno.benno /srv/benno/inbox
   37 chmod --silent 2770 /srv/benno/inbox
   38 set -e
   39 
   40 
   41 # Automatically added by dh_systemd_enable/13.3.4
   42 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
   43     # This will only remove masks created by d-s-h on package removal.
   44     deb-systemd-helper unmask 'benno-smtp.service' >/dev/null || true
   45 
   46     # was-enabled defaults to true, so new installations run enable.
   47     if deb-systemd-helper --quiet was-enabled 'benno-smtp.service'; then
   48         # Enables the unit on first installation, creates new
   49         # symlinks on upgrades if the unit file has changed.
   50         deb-systemd-helper enable 'benno-smtp.service' >/dev/null || true
   51     else
   52         # Update the statefile to add new symlinks (if any), which need to be
   53         # cleaned up on purge. Also remove old symlinks.
   54         deb-systemd-helper update-state 'benno-smtp.service' >/dev/null || true
   55     fi
   56 fi
   57 # End automatically added section
   58 # Automatically added by dh_systemd_start/13.3.4
   59 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
   60     if [ -d /run/systemd/system ]; then
   61         systemctl --system daemon-reload >/dev/null || true
   62         if [ -n "$2" ]; then
   63             _dh_action=restart
   64         else
   65             _dh_action=start
   66         fi
   67         deb-systemd-invoke $_dh_action 'benno-smtp.service' >/dev/null || true
   68     fi
   69 fi
   70 # End automatically added section
   71 # Automatically added by dh_installinit/13.3.4
   72 if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
   73     if [ -x "/etc/init.d/benno-smtp" ]; then
   74         update-rc.d benno-smtp defaults >/dev/null
   75         if [ -n "$2" ]; then
   76             _dh_action=restart
   77         else
   78             _dh_action=start
   79         fi
   80         invoke-rc.d benno-smtp $_dh_action || exit 1
   81     fi
   82 fi
   83 # End automatically added section
   84 
   85 
   86 exit 0