Prva inacica paketa za Debian squeeze distribuciju.
[mod-security-cn.git] / debian / prerm
index 5087d77..bd99613 100644 (file)
@@ -10,18 +10,17 @@ set -e
 #                    2 - file exists, but it is not tagged
 #
 chk_conf_tag () {
-
-        local conf_file
-        conf_file="$1"
-        RET=1
-
-        if [ -f "$conf_file" ]; then
-            if egrep -q "^## Begin - Generated by CARNet package mod-security-cn$" "$conf_file"; then
-                RET=0
-            else
-                RET=2
-            fi
+    local conf_file
+    conf_file="$1"
+    RET=1
+
+    if [ -f "$conf_file" ]; then
+        if egrep -q "^## Begin - Generated by CARNet package mod-security-cn$" "$conf_file"; then
+            RET=0
+        else
+            RET=2
         fi
+    fi
 }
 
 
@@ -63,17 +62,9 @@ case "$1" in
         done
 
         # Restart Apache2 web server.
-       if [ $need_restart -eq 1 ]; then
+        if [ $need_restart -eq 1 ]; then
             if apache2ctl configtest 2>/dev/null; then
-
-                # 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 || true
-                    else
-                        /etc/init.d/apache2 restart || true
-                    fi
-                fi
+                invoke-rc.d apache2 force-reload || true
             else
                 # Something is broken.
                 cp_echo "CN: Your Apache2 configuration seem to be broken."
@@ -94,4 +85,6 @@ case "$1" in
         ;;
 esac
 
+#DEBHELPER#
+
 exit 0