X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=blobdiff_plain;f=debian%2Fpostinst;fp=debian%2Fpostinst;h=44f707c6190add26642cfd5ca7a8de62c287138b;hb=c2dd5bf0af4977fba1bca2c204a0414469bf4958;hp=96bf5f7d85f7bbc38e31303c76b40e2a78a37546;hpb=d88c1a9e47b7892de4eda2a2a3f2494681c70856;p=mod-security-cn.git diff --git a/debian/postinst b/debian/postinst index 96bf5f7..44f707c 100644 --- a/debian/postinst +++ b/debian/postinst @@ -106,7 +106,7 @@ if [ -e "$CONF" ]; then fi -# Generate ModSecurity configuration file and activate RBL lookup +# Generate ModSecurity configuration files and activate RBL lookup # for ModSecurity if needed. # chk_conf_tag "$MODSECCONF" @@ -126,7 +126,6 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then out=$(mktemp $MODSECCONF.XXXXXX) temp_files="${temp_files} ${out}" - cp "$MODSECTPL/$(basename $MODSECCONF)" "$out" db_get mod-security-cn/rbl || true if [ "$RET" = "true" ]; then @@ -136,7 +135,7 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then if [ $RET -eq 1 ]; then - cp_echo "CN: Creating new configuration file $MODSECRBL" + cp_echo "CN: Creating configuration file $MODSECRBL" cp "$MODSECTPL/$(basename $MODSECRBL)" "$MODSECRBL" need_restart=1 else @@ -148,9 +147,8 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then fi fi - cp_check_and_sed '#RBLLOOKUP#' \ - "s,#RBLLOOKUP#,Include $MODSECRBL,g" \ - "$out" || true + sed "s,#RBLLOOKUP#,Include $MODSECRBL,g" \ + "$MODSECTPL/$(basename $MODSECCONF)" > "$out" if [ -e "$MODSECCONF" ]; then if ! cmp -s "$MODSECCONF" "$out"; then @@ -160,7 +158,7 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then need_restart=1 fi else - cp_echo "CN: Creating new configuration file $MODSECCONF" + cp_echo "CN: Creating configuration file $MODSECCONF" mv "$out" "$MODSECCONF" cp_echo "CN: Enabled ModSecurity RBL lookup." need_restart=1 @@ -168,9 +166,8 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then else # Remove RBL configuration. - cp_check_and_sed '#RBLLOOKUP#' \ - "s,#RBLLOOKUP#,# DISABLED,g" \ - "$out" || true + sed "s,#RBLLOOKUP#,# DISABLED,g" \ + "$MODSECTPL/$(basename $MODSECCONF)" > "$out" if [ -e "$MODSECCONF" ]; then if ! cmp -s "$MODSECCONF" "$out"; then @@ -180,7 +177,7 @@ if [ $RET -eq 0 ] || [ $RET -eq 1 ]; then need_restart=1 fi else - cp_echo "CN: Creating new configuration file $MODSECCONF" + cp_echo "CN: Creating configuration file $MODSECCONF" mv "$out" "$MODSECCONF" cp_echo "CN: Disabled ModSecurity RBL lookup." need_restart=1