Skip to content

Commit

Permalink
update tools/csfcf.sh
Browse files Browse the repository at this point in the history
double check if cloudflare ip is in csf.ignore and if not add it https://community.centminmod.com/posts/45911/
  • Loading branch information
centminmod committed Mar 7, 2017
1 parent 71dd63d commit 6b5b8c6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tools/csfcf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ csfadd() {

for ip in $CFIPS;
do
if [[ "$(grep "$ip" /etc/csf/csf.allow >/dev/null 2>&1; echo $?)" = '1' ]]; then
if [[ "$(grep "$ip" /etc/csf/csf.allow >/dev/null 2>&1; echo $?)" = '1' ]] || [[ "$(grep "$ip" /etc/csf/csf.ignore >/dev/null 2>&1; echo $?)" = '1' ]]; then
csf -a "$ip" cloudflare
echo "$ip" >> /etc/csf/csf.ignore
fi
Expand All @@ -131,7 +131,7 @@ csfadd() {
if [[ "$(awk -F '= ' '/^IPV6 =/ {print $2}' /etc/csf/csf.conf | sed -e 's|\"||g')" = '1' ]]; then
for ip in $CFIP6S;
do
if [[ "$(grep "$ip" /etc/csf/csf.allow >/dev/null 2>&1; echo $?)" = '1' ]]; then
if [[ "$(grep "$ip" /etc/csf/csf.allow >/dev/null 2>&1; echo $?)" = '1' ]] || [[ "$(grep "$ip" /etc/csf/csf.ignore >/dev/null 2>&1; echo $?)" = '1' ]]; then
csf -a "$ip" cloudflare
echo "$ip" >> /etc/csf/csf.ignore
fi
Expand Down

0 comments on commit 6b5b8c6

Please sign in to comment.