root/alternc/trunk/debian/alternc.preinst

Revision 2350, 2.6 kB (checked in by anarcat, 3 months ago)

don't maintain override_php symlink in preinst, it's already done in alternc.install

  • Property svn:mergeinfo set to
Line 
1 #!/bin/sh
2
3 set -e
4
5 . /usr/share/debconf/confmodule
6
7 case "$1" in
8   install)
9     ;;
10
11   upgrade)
12     if dpkg --compare-versions "$2" lt "0.9.4"; then
13         echo "Upgrading bind configuration"
14         # Move /etc/bind files around
15         mkdir -p /var/alternc/bind
16         if [ ! -e /var/alternc/bind/automatic.conf -a \
17              -f /etc/bind/automatic.conf ]; then
18             if [ ! -e /var/alternc/bind/zones ]; then
19                 mkdir -p /var/alternc/bind/zones
20             fi
21             for zone in `sed -n -e 's,.*/etc/bind/master/\(.*\)".*,\1,p' \
22                              /etc/bind/automatic.conf`; do
23                 if [ -f /etc/bind/master/$zone ]; then
24                     mv /etc/bind/master/$zone /var/alternc/bind/zones
25                 fi
26             done
27             cp -a -f /etc/bind/automatic.conf /var/alternc/bind/automatic.conf
28             sed -e 's,/etc/bind/master,/var/alternc/bind/zones,g' \
29                 < /etc/bind/automatic.conf > /var/alternc/bind/automatic.conf
30             rm /etc/bind/automatic.conf
31         fi
32         if [ ! -e /var/alternc/bind/slaveip.conf -a \
33              -f /etc/bind/slaveip.conf ]; then
34             mv /etc/bind/slaveip.conf /var/alternc/bind/slaveip.conf
35         fi
36         if [ ! -e /etc/bind/templates ]; then
37             mkdir -p /etc/bind/templates
38         fi
39         if [ ! -e /etc/bind/templates/named.template -a \
40              -f /etc/bind/domaines.template ]; then
41             mv /etc/bind/domaines.template /etc/bind/templates/named.template
42         fi
43         if [ ! -e /etc/bind/templates/zone.template -a \
44              -f /etc/bind/master/domaines.template ]; then
45             mv /etc/bind/master/domaines.template \
46                /etc/bind/templates/zone.template
47         fi
48         if [ -f /etc/bind/master/mx.template ]; then
49             rm /etc/bind/master/mx.template
50         fi
51         if [ -f /etc/bind/master/slave.template ]; then
52             rm /etc/bind/master/slave.template
53         fi
54         rmdir /etc/bind/master 2> /dev/null ||
55             echo "/etc/bind/master was not empty. Please remove it manually."
56     fi
57
58     if [ ! -h /var/alternc/bureau/admin/menulist.txt ]; then
59         if [ -f /var/alternc/bureau/admin/menulist.txt ]; then
60             mv -f /var/alternc/bureau/admin/menulist.txt \
61                   /etc/alternc/menulist.txt
62             ln -sf /etc/alternc/menulist.txt \
63                   /var/alternc/bureau/admin/menulist.txt
64         fi
65     fi
66
67     ;;
68
69   abort-upgrade)
70     ;;
71
72   *)
73     echo "preinst called with unknown argument '$1'" >&2
74     exit 1
75     ;;
76
77 esac
78
79 #DEBHELPER#
80
81 # vim: et sw=4
82
Note: See TracBrowser for help on using the browser.