8 # Include CARNet functions.
9 . /usr/share/carnet-tools/functions.sh
13 CONFDIR="$A2DIR/conf.d"
14 MODSECCONF="$CONFDIR/mod-security-cn.conf"
17 # Remove configuration file generated by this CARNet package.
18 if [ -f "$MODSECCONF" ]; then
19 if egrep -q "^## Begin - Generated by CARNet package mod-security-cn$" "$MODSECCONF"; then
20 cp_echo "CN: Removing configuration file ${MODSECCONF}."
26 # Restart Apache2 web server.
27 if [ $need_restart -eq 1 ]; then
28 if apache2ctl configtest 2>/dev/null; then
30 # Restart Apache2 web server.
31 if [ -x "/etc/init.d/apache2" ]; then
32 if [ -x "`which invoke-rc.d 2>/dev/null`" ]; then
33 invoke-rc.d apache2 restart || true
35 /etc/init.d/apache2 restart || true
39 # Something is broken.
40 cp_echo "CN: Your Apache2 configuration seem to be broken."
41 cp_echo "CN: Please, check the service configuration!"
50 upgrade|failed-upgrade)
53 echo "prerm called with unknown argument \$1'" >&2