]> git.proxmox.com Git - pve-manager.git/blob - debian/postrm
add systemd timer unit to trigger pvesr run
[pve-manager.git] / debian / postrm
1 #! /bin/sh
2
3 # Abort if any command returns an error value
4 set -e
5
6 case "$1" in
7 purge)
8 rm -rf /var/log/pveproxy
9 rm -rf /var/lib/pve-manager
10 ;;
11
12 remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
13 rm -f /etc/cron.d/pveupdate
14 ;;
15
16 *)
17 echo "postrm called with unknown argument \`$1'" >&2
18 exit 1
19 ;;
20 esac
21
22 # same as dh_systemd_enable (code copied)
23 systemctl --system daemon-reload >/dev/null || true
24
25 PVESERVICES="pvedaemon pveproxy spiceproxy pvestatd pvebanner pvenetcommit pve-manager"
26 PVETIMERS="pvesr"
27
28 if [ "$1" = "remove" ]; then
29 for timer in ${PVETIMERS}; do
30 if [ -x "/usr/bin/deb-systemd-helper" ]; then
31 deb-systemd-helper mask $timer.timer >/dev/null
32 fi
33 done
34 for service in ${PVESERVICES}; do
35 if [ -x "/usr/bin/deb-systemd-helper" ]; then
36 deb-systemd-helper mask $service.service >/dev/null
37 fi
38 done
39 fi
40
41 if [ "$1" = purge ]; then
42 for timer in ${PVETIMERS}; do
43 if [ -x "/usr/bin/deb-systemd-helper" ]; then
44 deb-systemd-helper purge $timer.timer >/dev/null
45 deb-systemd-helper unmask $timer.timer >/dev/null
46 fi
47 done
48 for service in ${PVESERVICES}; do
49 if [ -x "/usr/bin/deb-systemd-helper" ]; then
50 deb-systemd-helper purge $service.service >/dev/null
51 deb-systemd-helper unmask $service.service >/dev/null
52 fi
53 done
54 fi