Add post installation and pre removal script for debian package.
This commit is contained in:
parent
78839ece3b
commit
7eb1ee8305
2 changed files with 50 additions and 0 deletions
24
deb/drone/DEBIAN/postinst
Executable file
24
deb/drone/DEBIAN/postinst
Executable file
|
@ -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
|
26
deb/drone/DEBIAN/prerm
Executable file
26
deb/drone/DEBIAN/prerm
Executable file
|
@ -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
|
Loading…
Reference in a new issue