debian: add postinst and triggers files for hobo-redeploy (#8894)

This commit is contained in:
Benjamin Dauvergne 2015-12-18 23:21:07 +01:00
parent 0257dee49f
commit 208152976b
2 changed files with 42 additions and 0 deletions

41
debian/postinst vendored Normal file
View File

@ -0,0 +1,41 @@
#!/bin/sh
set -e
NAME=wcs
DAEMON=/usr/sbin/wcsctl
WCS_USER=www-data
CONFIG_FILE=/etc/wcs/wcs.cfg
# Read config file if it is present.
if [ -r /etc/default/$NAME ]
then
. /etc/default/$NAME
fi
if [ $CONFIG_FILE ]; then
COMMAND="$DAEMON -f $CONFIG_FILE"
else
COMMAND="$DAEMON"
fi
case "$1" in
configure)
;;
triggered)
su -c "$COMMAND check_hobos --redeploy" $WCS_USER
;;
abort-upgrade|abort-remove|abort-deconfigure)
;;
*)
echo "postinst called with unknown argument \`$1'" >&2
exit 1
;;
esac
#DEBHELPER#
exit 0

1
debian/triggers vendored Normal file
View File

@ -0,0 +1 @@
interest-noawait hobo-redeploy