X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;ds=sidebyside;f=debian%2Fpostinst;h=fd77bf0803370457797a02458f7b3b49c5cb182f;hb=e435400885c7061bd5eab8936773b8f347b97a62;hp=2f61213ca9a3f8dd757696e66103923263400b46;hpb=d6d471ca8237b76920e6c78385214ffe26ce6dc6;p=mod-security-cn.git diff --git a/debian/postinst b/debian/postinst index 2f61213..fd77bf0 100644 --- a/debian/postinst +++ b/debian/postinst @@ -43,7 +43,6 @@ if [ -e /usr/share/apache2/apache2-maintscript-helper ]; then . /usr/share/apache2/apache2-maintscript-helper modsecurity_enable() { - cp_echo "CN: Enabling $PKG configuration for Apache2." return 0 } else @@ -97,6 +96,13 @@ chk_conf_tag () { trap cleanup 0 1 2 15 +# Enable ModSecurity and unique_id Apache2 modules. +# +if modsecurity_enable; then + apache2_invoke enmod security2 +fi + + # Remove obsolete symbolic link. # if [ "`readlink -q -m /etc/apache2/conf.d/$PKG.conf`" = "$MODSECCONF" ]; then @@ -183,15 +189,17 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then fi if [ -f "$out" ]; then rm -f $out; fi +fi - # Enable ModSecurity configuration. - if [ ! -e "$MODSECLNK" ]; then - ln -fs "$MODSECCONF" "$MODSECLNK" - fi - if modsecurity_enable; then - apache2_invoke enmod security2 - apache2_invoke enconf security2-cn - fi + +# Enable ModSecurity configuration. +# +if [ ! -e "$MODSECLNK" ]; then + ln -fs "$MODSECCONF" "$MODSECLNK" +fi +if modsecurity_enable; then + cp_echo "CN: Enabling $PKG configuration for Apache2." + apache2_invoke enconf security2-cn fi db_stop || true