preinst 565 Bytes
Newer Older
Dietmar Maurer's avatar
Dietmar Maurer committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#!/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
15
			service $i stop
Dietmar Maurer's avatar
Dietmar Maurer committed
16 17
		    fi
		done
18
		sleep 2
Dietmar Maurer's avatar
Dietmar Maurer committed
19 20 21 22 23 24 25 26 27 28 29 30 31 32
	    fi
	fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

exit 0