Skip to content

Instantly share code, notes, and snippets.

@le0park
Created May 15, 2019 01:50
Show Gist options
  • Save le0park/c20eb8bb82950c2592fb478ebf5a7787 to your computer and use it in GitHub Desktop.
Save le0park/c20eb8bb82950c2592fb478ebf5a7787 to your computer and use it in GitHub Desktop.

Revisions

  1. le0park created this gist May 15, 2019.
    4 changes: 4 additions & 0 deletions add_blocking_ip.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    while IFS='' read -r line || [[ -n "$line" ]]; do
    echo "Blocking IP: $line..."
    iptables -A INPUT -s $line -j DROP || { echo 'Blocking failed.' ; exit 1; }
    done < "$1"