File: /var/lib/dpkg/info/bitninja.postinst
#!/bin/sh
# postinst script for bitninja
#
# see: dh_installdeb(1)
set -e
# summary of how this script can be called:
# * <postinst> `configure' <most-recently-configured-version>
# * <old-postinst> `abort-upgrade' <new version>
# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
# <new-version>
# * <postinst> `abort-remove'
# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
# <failed-install-package> <version> `removing'
# <conflicting-package> <version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package
case "$1" in
configure)
chmod 755 /etc/cron.hourly/logrotate-bitninja
chmod 644 /etc/logrotate.d/bitninja-inotify
getent passwd bitninja >/dev/null || /usr/sbin/useradd -r -U -d /var/lib/bitninja -s /bin/false -c 'bitninja' bitninja
if [ -x "/etc/systemd/system/bitninja.service" ]; then
/bin/systemctl daemon-reload
if [ -e /bin/systemctl ]; then
/bin/systemctl enable bitninja
elif [ -e /usr/bin/systemctl ]; then
/usr/bin/systemctl enable bitninja
else
echo "Could not enable BitNinja."
fi
if [ -e /var/lib/bitninja/ChangelogConfig.sh ]; then
/bin/sh /var/lib/bitninja/ChangelogConfig.sh
fi
if [ -z "$2" ]; then
# install
/bin/systemctl start bitninja
else
# upgrade
/bin/systemctl restart bitninja
fi
fi
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
exit 0