7 MODSECCONF=/etc/apache2/mod-security/$PKG.conf
8 MODSECRBL=/etc/apache2/mod-security/rbl_lookup.conf
9 MODSECLNK=/etc/apache2/conf-available/security2-cn.conf
13 # Check if configuration file has CARNET package info lines.
14 # return: $RET => 0 - tagged
15 # 1 - file does not exists
16 # 2 - file exists, but it is not tagged
23 if [ -f "$conf_file" ]; then
24 if egrep -q "^## Begin - Generated by CARNET package mod-security-cn$" "$conf_file"; then
32 if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then
33 . /usr/share/apache2/apache2-maintscript-helper
35 modsecurity_enable() {
36 chk_conf_tag "$MODSECLNK"
37 if [ $RET -ne 2 ]; then
38 echo "CN: Disabling $PKG configuration for Apache2."
44 echo "CN: Could not load Apache 2.4 maintainer script helper."
46 modsecurity_enable() {
51 if [ "$1" = "remove" ] || [ "$1" = "deconfigure" ]; then
52 # Disable ModSecurity configuration.
53 if modsecurity_enable; then
54 apache2_invoke disconf security2-cn
58 # Remove configuration files generated by this CARNET package.
59 for mfile in "$MODSECCONF" "$MODSECRBL"; do
61 if [ $RET -eq 0 ]; then
62 echo "CN: Removing configuration file $mfile"