summaryrefslogtreecommitdiff
path: root/debian/lighttpd.preinst
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2008-03-16 10:02:26 +0000
committerPierre Habouzit <madcoder@debian.org>2008-03-16 10:02:26 +0000
commitd6de1a650dc982d9de0adc5fc4a540639ee3d86d (patch)
tree8d4d575dba6a53c9573923a0f808c5400406d7c0 /debian/lighttpd.preinst
parentd115cb0b65601ec825d05c21b9b47532ec45a3f4 (diff)
downloadlighttpd-d6de1a650dc982d9de0adc5fc4a540639ee3d86d.tar.gz
OCloses 419176
Diffstat (limited to 'debian/lighttpd.preinst')
-rw-r--r--debian/lighttpd.preinst36
1 files changed, 36 insertions, 0 deletions
diff --git a/debian/lighttpd.preinst b/debian/lighttpd.preinst
new file mode 100644
index 0000000..aff4760
--- /dev/null
+++ b/debian/lighttpd.preinst
@@ -0,0 +1,36 @@
+#! /bin/sh -e
+# preinst script for lighttpd
+
+CA=/etc/lighttpd/conf-available
+CE=/etc/lighttpd/conf-enabled
+
+if test -f "$CA/10-auth.conf"; then
+ if test -f "$CA/05-auth.conf"; then
+ echo 1>&2 "Not touching conf-available/10-auth.conf because conf-available/05-auth.conf exists !!!"
+ echo 1>&2 "Please read /usr/share/doc/lighttpd/NEWS.Debian"
+ else
+ echo "Renaming conf-available/10-auth.conf into conf-available/05-auth.conf"
+ mv "$CA/10-auth.conf" "$CA/05-auto.conf"
+ fi
+fi
+
+if test -f "$CE/10-auth.conf"; then
+ if test -f "$CE/05-auth.conf"; then
+ echo 1>&2 "Not touching conf-enabled/10-auth.conf because conf-enabled/05-auth.conf exists !!!"
+ echo 1>&2 "Please read /usr/share/doc/lighttpd/NEWS.Debian"
+ else
+ if test -h "$CE/10-auth.conf" && test "$(readlink -m "$CE/10-auth.conf")" = "$CE/10-auth.conf"; then
+ echo "Updating conf-enabled symlink to 05-auth.conf accordingly"
+ rm -f "$CE/10-auth.conf"
+ ln -s "../conf-available/05-auth.conf" "$CE/05-auth.conf"
+ fi
+ if test -f "$CE/10-auth.conf"; then
+ echo "Renaming conf-enabled/10-auth.conf into conf-enabled/05-auth.conf"
+ mv "$CE/10-auth.conf" "$CE/05-auth.conf"
+ fi
+ fi
+fi
+
+#DEBHELPER#
+
+exit 0