From eeebb91e573769cef2850b793ba54a578a468d1b Mon Sep 17 00:00:00 2001 From: Alan Garcia Date: Fri, 28 Mar 2014 15:42:13 +0000 Subject: [PATCH] Migre les zones lors du changement de repertoire pour les zones bind (lors du passage en AlternC 3.1 Debian-compliant) --- .gitattributes | 1 + install/upgrades/3.1.0~c.sh | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+) create mode 100644 install/upgrades/3.1.0~c.sh diff --git a/.gitattributes b/.gitattributes index 2e6b2634..2b205bfe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -581,6 +581,7 @@ install/upgrades/3.0.3~a.sql -text install/upgrades/3.0.3~b.sh -text install/upgrades/3.1.0~a.sql -text install/upgrades/3.1.0~b.php -text +install/upgrades/3.1.0~c.sh -text install/upgrades/3.2.1~a.sql -text install/upgrades/3.3.0~a.sql -text install/upgrades/README -text diff --git a/install/upgrades/3.1.0~c.sh b/install/upgrades/3.1.0~c.sh new file mode 100644 index 00000000..ab5332f7 --- /dev/null +++ b/install/upgrades/3.1.0~c.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# Upgrading script to AlternC 3.0.3 + +CONFIG_FILE="/usr/lib/alternc/functions.sh" +PATH=/sbin:/bin:/usr/sbin:/usr/bin + +umask 022 + +if [ ! -r "$CONFIG_FILE" ]; then + echo "Can't access $CONFIG_FILE." + exit 1 +fi + +if [ `id -u` -ne 0 ]; then + echo "3.0.3~b.sh must be launched as root" + exit 1 +fi + +. "$CONFIG_FILE" + + +#### Migrate zone file of AlternC 1.0 from old directory + +# If no old directory, nothing to do here +test -d /var/alternc/bind/zones/ || exit 0 + +# Copy file but do not overwrite them +cp --no-clobber /var/alternc/bind/zones/* /var/lib/alternc/bind/zones/ + +# No need to regenerate zone, we are launched by upgrade_check, +# launched by alternc.install, and alternc.install regenerate everything +# when it end