35 lines
813 B
Bash
35 lines
813 B
Bash
#!/bin/sh
|
|
# prerm script for linux-hello-daemon
|
|
#
|
|
# see: dh_installdeb(1)
|
|
|
|
set -e
|
|
|
|
case "$1" in
|
|
remove|upgrade|deconfigure)
|
|
# Stop the service before removal
|
|
if [ -d /run/systemd/system ]; then
|
|
if systemctl is-active --quiet linux-hello.service 2>/dev/null; then
|
|
echo "Stopping linux-hello service..."
|
|
systemctl stop linux-hello.service || true
|
|
fi
|
|
if systemctl is-enabled --quiet linux-hello.service 2>/dev/null; then
|
|
echo "Disabling linux-hello service..."
|
|
systemctl disable linux-hello.service || true
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
failed-upgrade)
|
|
;;
|
|
|
|
*)
|
|
echo "prerm called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
#DEBHELPER#
|
|
|
|
exit 0
|