]> git.proxmox.com Git - vzctl.git/blob - debian/vzctl.preinst
set RELEASE=3.1
[vzctl.git] / debian / vzctl.preinst
1 #! /bin/sh
2 # preinst script for vzctl
3 #
4 # see: dh_installdeb(1)
5
6 set -e
7
8 # summary of how this script can be called:
9 # * <new-preinst> `install'
10 # * <new-preinst> `install' <old-version>
11 # * <new-preinst> `upgrade' <old-version>
12 # * <old-preinst> `abort-upgrade' <new-version>
13 #
14 # for details, see http://www.debian.org/doc/debian-policy/ or
15 # the debian-policy package
16
17 case "$1" in
18 install|upgrade)
19
20 # older version installed a symbolic link, we need to remove
21 # that - else dpkg does not install the new version
22 if [ -L "/etc/network/if-up.d/vzifup-post" ]; then
23 rm -f "/etc/network/if-up.d/vzifup-post"
24 fi
25
26 # move old config out of the way - newer version
27 # use a symlink to /etc/pve/openvz
28 if [ ! -L "/etc/vz/conf" ]; then
29 rmdir "/etc/vz/conf" || true # try to remove empty dir
30 if [ -e "/etc/vz/conf" ]; then
31 if [ -e "/etc/vz/conf.org" ]; then
32 echo "unable to backup existing configuration"
33 exit 1
34 fi
35 mv /etc/vz/conf /etc/vz/conf.org
36 fi
37 fi
38
39 # compability mode /var/lib/vz -> /vz
40 # ln -sT /var/lib/vz vz 2>/dev/null || true
41 # echo "Add a link from /var/lib/vz to /vz/"
42 ;;
43 abort-upgrade)
44 ;;
45 *)
46 echo "preinst called with unknown argument \`$1'" >&2
47 exit 1
48 ;;
49 esac
50
51 # dh_installdeb will replace this with shell code automatically
52 # generated by other debhelper scripts.
53
54 #DEBHELPER#
55
56 exit 0