Prva inacica paketa za Debian jessie distribuciju.
[squirrelmail-cn.git] / debian / prerm
old mode 100644 (file)
new mode 100755 (executable)
index 80f154e..019ab28
@@ -2,38 +2,32 @@
 
 set -e
 
-case "$1" in
-  remove|deconfigure)
-
-    cp-update -r squirrelmail-cn /etc/squirrelmail/apache.conf
-
-    if [ -f /etc/apache2/conf.d/squirrelmail-cn.conf ]; then
-        rm -f /etc/apache2/conf.d/squirrelmail-cn.conf
+PKG=squirrelmail-cn
+
+if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
+    . /usr/share/apache2/apache2-maintscript-helper
+
+    squirrelmail_enable() {
+        echo "CN: Disabling $PKG configuration for Apache2."
+        return 0
+    }
+else
+    echo "CN: Could not load Apache 2.4 maintainer script helper."
+
+    squirrelmail_enable() {
+        return 1
+    }
+fi
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+    if [ -f /etc/squirrelmail/apache.conf ]; then
+        cp-update -r $PKG /etc/squirrelmail/apache.conf
     fi
 
-    # Restart Apache2 web server.
-    #
-    if apache2ctl configtest 2>/dev/null; then
-        invoke-rc.d apache2 force-reload || true
-    else
-        echo "CN: Your Apache2 configuration is either broken or nonexistant."
+    if squirrelmail_enable; then
+        apache2_invoke disconf $PKG
     fi
-
-    break
-    ;;
-  upgrade)
-    :
-    ;;
-  failed-upgrade)
-    ;;
-  *)
-    echo "prerm called with unknown argument \$1'" >&2
-    exit 0
-    ;;
-esac
-
-# dh_installdeb will replace this with shell code automatically
-# generated by other debhelper scripts.
+fi
 
 #DEBHELPER#