2024-10-23 12:12:30 +03:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
2024-10-29 05:12:06 +03:00
|
|
|
have_systemd=1
|
|
|
|
[ -d /run/systemd/system ] || have_systemd=0
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
upgrade )
|
2024-10-23 12:12:30 +03:00
|
|
|
services='kvp vss'
|
2024-10-29 05:12:06 +03:00
|
|
|
if dpkg --compare-versions "$2" lt '6.10~rc6-1~exp1' ; then
|
|
|
|
services="fcopy ${services}"
|
2024-10-23 12:12:30 +03:00
|
|
|
fi
|
2024-10-29 05:12:06 +03:00
|
|
|
for i in ${services} ; do
|
|
|
|
init_service="hyperv-daemons.hv-$i-daemon"
|
|
|
|
systemd_unit="${init_service}.service"
|
|
|
|
if [ ${have_systemd} = 1 ] ; then
|
|
|
|
systemctl stop "${systemd_unit}" 2>/dev/null || true
|
2024-10-23 12:12:30 +03:00
|
|
|
fi
|
2024-10-29 05:12:06 +03:00
|
|
|
deb-systemd-helper purge "${systemd_unit}" || true
|
|
|
|
invoke-rc.d --skip-systemd-native "${init_service}" stop || true
|
|
|
|
update-rc.d "${init_service}" remove || true
|
|
|
|
done ; unset services i init_service systemd_unit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
unset have_systemd
|
2024-10-23 12:12:30 +03:00
|
|
|
|
|
|
|
#DEBHELPER#
|
|
|
|
|
|
|
|
exit 0
|