diff --git a/deb/drone/DEBIAN/postinst b/deb/drone/DEBIAN/postinst new file mode 100755 index 00000000..776f572b --- /dev/null +++ b/deb/drone/DEBIAN/postinst @@ -0,0 +1,24 @@ +#!/bin/sh +set -e + +case "$1" in + abort-upgrade|abort-remove|abort-deconfigure|configure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +echo "Starting drone ..." +if [ -f /etc/init/drone.conf ]; then + if pidof /usr/local/bin/droned >/dev/null; then + service drone stop || exit $? + fi + service drone start && echo "Drone started." +fi + +#DEBHELPER# + +exit 0 diff --git a/deb/drone/DEBIAN/prerm b/deb/drone/DEBIAN/prerm new file mode 100755 index 00000000..a0f7be8c --- /dev/null +++ b/deb/drone/DEBIAN/prerm @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e +set -u + +case "$1" in + remove|remove-in-favour|deconfigure|deconfigure-in-favour) + if [ -f /etc/init/drone.conf ]; then + echo "Stopping drone ..." + service drone stop || exit $? + echo "Drone Stopped." + fi + ;; + + upgrade|failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0