File: libapache2-modsecurity.postinst

package info (click to toggle)
modsecurity-apache 2.9.7-1%2Bdeb12u1
  • links: PTS
  • area: main
  • in suites: bookworm-proposed-updates
  • size: 10,440 kB
  • sloc: ansic: 51,935; sh: 4,516; perl: 2,340; cpp: 1,930; makefile: 620; xml: 6
file content (27 lines) | stat: -rw-r--r-- 648 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh
set -e

reload_apache()
{
  if apache2ctl configtest 2>/dev/null; then
    invoke-rc.d apache2 restart || true
  else    
    echo "Your apache2 configuration is broken, so we're not restarting it for you."
  fi
}

#DEBHELPER#

if [ -n "$2" ]; then
# remove dangling symlinks from previous versions
  if [ -n "$2" ] && dpkg --compare-versions "$2" lt 2.8.0-2 ; then
    for SYMLINK in mod-security.load mod-security.conf ; do
      if [ -L "/etc/apache2/mods-enabled/$SYMLINK" ] && [ ! -e "/etc/apache2/mods-enabled/$SYMLINK" ] ; then
        rm -f "/etc/apache2/mods-enabled/$SYMLINK"
      fi
    done
    reload_apache
  fi
fi

exit 0