Browse Source

creating backup when doing sed causes nginx warnings

master
Daniel Martinez 1 year ago
parent
commit
09b2f5372c
  1. 2
      scripts/bashblocker.sh

2
scripts/bashblocker.sh

@ -54,7 +54,7 @@ for script in $(echo ${scripts} | sed "s/,/ /g" ); do
fi
if [[ -z $(grep DENYRULES ${nginx_conf}) ]]; then
script_type=$(echo ${script} | cut -d"." -f2)
sed -i.bk "/.${script_type} {/ a \ \#DENYRULES;" ${nginx_conf}
sed -i "/.${script_type} {/ a \ \#DENYRULES;" ${nginx_conf}
echo "$(date -Is) - formatted ${nginx_conf} to be able to add deny rules to appropiate position" >> ${log}
nginx_reload_check
fi

Loading…
Cancel
Save