From: Dragan Dosen Date: Fri, 29 May 2009 19:39:39 +0000 (+0200) Subject: Ispravljena greska u debian/prerm. Modificiran debian/postinst. X-Git-Tag: v2.5.12+2~3 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?p=mod-security-cn.git;a=commitdiff_plain;h=refs%2Fheads%2Flenny Ispravljena greska u debian/prerm. Modificiran debian/postinst. --- 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 diff --git a/debian/prerm b/debian/prerm index d574e4e..5087d77 100644 --- a/debian/prerm +++ b/debian/prerm @@ -60,7 +60,7 @@ case "$1" in rm -f $file need_restart=1 fi - fi + done # Restart Apache2 web server. if [ $need_restart -eq 1 ]; then