Adds support for conditionally disabling VM creation.
[invirt/packages/invirt-web.git] / debian / invirt-web.preinst
1 #!/bin/sh
2 # preinst script for #PACKAGE#
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 # for details, see http://www.debian.org/doc/debian-policy/ or
14 # the debian-policy package
15
16
17 case "$1" in
18     install|upgrade)
19         if ! getent group invirt > /dev/null; then
20             addgroup --system invirt
21         fi
22
23         if dpkg --compare-versions "$2" lt 0.1.6~; then
24             mv /var/www/invirt-web /var/www/invirt-web.bak || :
25         fi
26     ;;
27
28     abort-upgrade)
29     ;;
30
31     *)
32         echo "preinst called with unknown argument \`$1'" >&2
33         exit 1
34     ;;
35 esac
36
37 # dh_installdeb will replace this with shell code automatically
38 # generated by other debhelper scripts.
39
40 #DEBHELPER#
41
42 exit 0
43
44