5 . /usr/share/debconf/confmodule
7 # Create AlternC Panel user for web server
8 if ! getent group alterncpanel; then
9 addgroup --system --gid 1999 alterncpanel
11 if ! getent passwd alterncpanel; then
12 adduser --system --home "/etc/alternc/.alterncpanel" \
13 --disabled-password --uid 1999 --ingroup alterncpanel alterncpanel
21 if dpkg --compare-versions "$2" lt "0.9.4"; then
22 echo "Upgrading bind configuration"
23 # Move /etc/bind files around
24 mkdir -p /var/alternc/bind
25 if [ ! -e /var/alternc/bind/automatic.conf -a \
26 -f /etc/bind/automatic.conf ]; then
27 if [ ! -e /var/alternc/bind/zones ]; then
28 mkdir -p /var/alternc/bind/zones
30 for zone in `sed -n -e 's,.*/etc/bind/master/\(.*\)".*,\1,p' \
31 /etc/bind/automatic.conf`; do
32 if [ -f /etc/bind/master/$zone ]; then
33 mv /etc/bind/master/$zone /var/alternc/bind/zones
36 cp -a -f /etc/bind/automatic.conf /var/alternc/bind/automatic.conf
37 sed -e 's,/etc/bind/master,/var/alternc/bind/zones,g' \
38 < /etc/bind/automatic.conf > /var/alternc/bind/automatic.conf
39 rm /etc/bind/automatic.conf
41 if [ ! -e /var/alternc/bind/slaveip.conf -a \
42 -f /etc/bind/slaveip.conf ]; then
43 mv /etc/bind/slaveip.conf /var/alternc/bind/slaveip.conf
45 if [ ! -e /etc/bind/templates ]; then
46 mkdir -p /etc/bind/templates
48 if [ ! -e /etc/bind/templates/named.template -a \
49 -f /etc/bind/domaines.template ]; then
50 mv /etc/bind/domaines.template /etc/bind/templates/named.template
52 if [ ! -e /etc/bind/templates/zone.template -a \
53 -f /etc/bind/master/domaines.template ]; then
54 mv /etc/bind/master/domaines.template \
55 /etc/bind/templates/zone.template
57 if [ -f /etc/bind/master/mx.template ]; then
58 rm /etc/bind/master/mx.template
60 if [ -f /etc/bind/master/slave.template ]; then
61 rm /etc/bind/master/slave.template
63 rmdir /etc/bind/master 2> /dev/null ||
64 echo "/etc/bind/master was not empty. Please remove it manually."
73 echo "preinst called with unknown argument '$1'" >&2