Skip to content

Instantly share code, notes, and snippets.

@akrasic
Last active October 27, 2016 20:12
Show Gist options
  • Select an option

  • Save akrasic/1dd583fc71f10f7950708c21fbc760c7 to your computer and use it in GitHub Desktop.

Select an option

Save akrasic/1dd583fc71f10f7950708c21fbc760c7 to your computer and use it in GitHub Desktop.
Check CSF for IP blocks
#!/bin/bash
ipfile=$1
for i in $(cat $ipfile); do
if ! csf -g $i | grep -q "No matches"; then
echo "IP $i blocked"
grep $i /etc/csf/csf.deny
echo ""
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment