2010-02-24 21:58:53 +00:00
|
|
|
#!/bin/sh -e
|
|
|
|
|
|
|
|
# the DEBHELPER token is purposely not used
|
|
|
|
# because we don't want the daemon to be
|
|
|
|
# stopped during an upgrade
|
|
|
|
|
2015-03-15 10:14:01 +00:00
|
|
|
handle_start_failure () {
|
|
|
|
# The MODE defined in /etc/nut/nut.conf shouldn't affect the exit code when the
|
|
|
|
# daemon is stopped. If it fails to stop, the maintainer script should fail
|
|
|
|
# too.
|
|
|
|
return 1
|
|
|
|
}
|
|
|
|
|
2010-02-24 21:58:53 +00:00
|
|
|
case "$1" in
|
|
|
|
|
|
|
|
remove)
|
|
|
|
# nut-usb specifics
|
|
|
|
[ -f /etc/hotplug/usb/libhid.usermap ] && rm -f /etc/hotplug/usb/libhid.usermap
|
|
|
|
[ -f /etc/hotplug/usb/libhidups ] && rm -f /etc/hotplug/usb/libhidups
|
|
|
|
|
|
|
|
[ -L /usr/doc/nut ] && rm -f /usr/doc/nut
|
|
|
|
# do stop the daemon on remove
|
|
|
|
invoke-rc.d nut stop && sleep 1
|
2019-07-27 11:25:06 +00:00
|
|
|
[ -d /run/nut ] && rm -rf /run/nut/
|
2010-02-24 21:58:53 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
upgrade)
|
|
|
|
[ -L /usr/doc/nut ] && rm -f /usr/doc/nut
|
|
|
|
# do not stop the daemon on upgrade
|
|
|
|
;;
|
|
|
|
|
|
|
|
failed-upgrade)
|
|
|
|
# do nothing
|
|
|
|
;;
|
|
|
|
|
|
|
|
deconfigure)
|
|
|
|
# do nothing
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "$0: incorrect arguments: $*" >&2
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
exit 0
|