-
- # Remove configuration files generated by this CARNet package.
- for file in "$MODSECCONF" "$MODSECRBL"; do
- chk_conf_tag "$file"
- if [ $RET -eq 0 ]; then
- cp_echo "CN: Removing configuration file $file"
- rm -f $file
- need_restart=1
- fi
- done
-
- # Restart Apache2 web server.
- 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
- else
- # Something is broken.
- cp_echo "CN: Your Apache2 configuration seem to be broken."
- cp_echo "CN: Please, check the service configuration!"
- fi
+ return 1
+ }
+else
+ echo "CN: Could not load Apache 2.4 maintainer script helper."
+
+ modsecurity_enable() {
+ return 1
+ }
+fi
+
+if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
+ # Disable ModSecurity configuration.
+ if modsecurity_enable; then
+ apache2_invoke disconf security2-cn
+ rm -f "$MODSECLNK"
+ fi
+
+ # Remove configuration files generated by this CARNet package.
+ for mfile in "$MODSECCONF" "$MODSECRBL"; do
+ chk_conf_tag "$mfile"
+ if [ $RET -eq 0 ]; then
+ echo "CN: Removing configuration file $mfile"
+ rm -f "$mfile"