Prva inacica paketa za Debian jessie distribuciju.
[squirrelmail-cn.git] / debian / prerm
old mode 100644 (file)
new mode 100755 (executable)
index db2980a..019ab28
@@ -2,36 +2,33 @@
 
 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
-       fi
-
-       # Restart Apache2 web server.
-       #
-       if [ -x "/etc/init.d/apache2" ]; then
-               if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
-                    invoke-rc.d apache2 force-reload || exit $?
-               else
-                    /etc/init.d/apache2 force-reload || exit $?
-               fi
-       fi
-
-       break
-       ;;
-  upgrade)
-       :
-       ;;
-  failed-upgrade)
-       ;;
-  *)
-       echo "prerm called with unknown argument \$1'" >&2
-       exit 0
-       ;;
-esac
+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
+
+    if squirrelmail_enable; then
+        apache2_invoke disconf $PKG
+    fi
+fi
+
+#DEBHELPER#
 
 exit 0