Prva inacica paketa za Debian squeeze distribuciju.
[squirrelmail-cn.git] / debian / prerm
index 459bac8..80f154e 100644 (file)
@@ -5,33 +5,36 @@ 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 restart || exit $?
-               else
-                    /etc/init.d/apache2 restart || exit $?
-               fi
-       fi
-
-       break
-       ;;
+    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 apache2ctl configtest 2>/dev/null; then
+        invoke-rc.d apache2 force-reload || true
+    else
+        echo "CN: Your Apache2 configuration is either broken or nonexistant."
+    fi
+
+    break
+    ;;
   upgrade)
-       :
-       ;;
+    :
+    ;;
   failed-upgrade)
-       ;;
+    ;;
   *)
-       echo "prerm called with unknown argument \$1'" >&2
-       exit 0
-       ;;
+    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.
+
+#DEBHELPER#
+
 exit 0