54 lines
1.8 KiB
Text
54 lines
1.8 KiB
Text
|
#! /bin/sh
|
||
|
|
||
|
set -e
|
||
|
|
||
|
# In case this system is running systemd, we make systemd reload the unit files
|
||
|
# to pick up changes.
|
||
|
if [ -d /run/systemd/system ] ; then
|
||
|
systemctl --system daemon-reload >/dev/null || true
|
||
|
fi
|
||
|
|
||
|
|
||
|
|
||
|
# System-Services:
|
||
|
# put in full unit-name. for example "mkbackup@hourly.service"
|
||
|
#SERVICES="mkbackup.target backup.automount var-cache-backup.automount btrfs-scrub@var-cache-btrfs_pool_SYSTEM.service mkbackup@manually.service mkbackup@aptupgrade.service mkbackup@daily.service mkbackup@weekly.service mkbackup@monthly.service mkbackup@plugin.service mkbackup@manually.service"
|
||
|
SERVICES="mkbackup.target backup.automount var-cache-btrfs_pool_SYSTEM.automount"
|
||
|
INTERVALS="hourly daily weekly aptupgrade plugin afterboot manually"
|
||
|
CINT="$(for i in $INTERVALS;do echo "mkbackup@${i}.service" ; done)"
|
||
|
INSTSERVICES="btrfs-scrub@var-cache-btrfs_pool_SYSTEM.service mkbackup-conf@mkbackup\x2dbtrfs.path mkbackup-conf@mkbackup\x2dbtrfs.service"
|
||
|
|
||
|
|
||
|
case "$1" in
|
||
|
purge)
|
||
|
# systemctl disable $SERVICES $INSTSERVICES
|
||
|
# for s in $INSTSERVICES;do
|
||
|
# rm -rf /lib/systemd/system/${s}
|
||
|
# done
|
||
|
|
||
|
if [ -x "/usr/bin/deb-systemd-helper-new" ]; then
|
||
|
deb-systemd-helper-new purge $SERVICES $INSTSERVICES $CINT >/dev/null
|
||
|
deb-systemd-helper-new unmask $SERVICES $INSTSERVICES $CINT >/dev/null
|
||
|
fi
|
||
|
;;
|
||
|
abort-upgrade)
|
||
|
;;
|
||
|
remove)
|
||
|
# systemctl mask $SERVICES
|
||
|
# for s in $INSTSERVICES;do
|
||
|
# ln -s /dev/null /lib/systemd/system/${s}
|
||
|
# done
|
||
|
if [ -x "/usr/bin/deb-systemd-helper-new" ]; then
|
||
|
deb-systemd-helper-new mask $SERVICES $INSTSERVICES $CINT >/dev/null
|
||
|
fi
|
||
|
;;
|
||
|
upgrade|failed-upgrade|abort-install|disappear)
|
||
|
;;
|
||
|
|
||
|
*)
|
||
|
echo "postrm called with unknown argument \`$1'" >&2
|
||
|
exit 0
|
||
|
;;
|
||
|
|
||
|
esac
|