33 lines
565 B
Bash
33 lines
565 B
Bash
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
DAEMONS="pveproxy spiceproxy pvestatd pvedaemon"
|
|
|
|
case "$1" in
|
|
install|upgrade)
|
|
old_version=$2
|
|
if [ ! -e /proxmox_install_mode ]; then
|
|
if dpkg --compare-versions "$old_version" lt '3.3-9' ; then
|
|
echo "Detected old pve-manager version - using stop/start to restart daemons"
|
|
for i in ${DAEMONS}; do
|
|
if [ -e "/usr/bin/$i" ]; then
|
|
service $i stop
|
|
fi
|
|
done
|
|
sleep 2
|
|
fi
|
|
fi
|
|
;;
|
|
|
|
abort-upgrade)
|
|
;;
|
|
|
|
*)
|
|
echo "preinst called with unknown argument \`$1'" >&2
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
exit 0
|