#!/bin/bash function show_help() { cat </dev/null if [ "$USE_ASNIP" == "1" ]; then asnip -c -t $1 else CIDRS=$(curl -s -A "blockable.sh script " https://asntool.com/$1 | awk '{if (NR<3) {} else {$1=$1}};1') echo "$CIDRS" | head -2 echo echo ---------- echo "$CIDRS" | tail -n +3 > cidrs.txt fi echo Copy the following to edgeos: echo for cidr in $(aggregate -q < cidrs.txt); do echo set firewall group network-group ${2:-Infiltrators} network $cidr if [ $(echo $1 | grepcidr -c -e $cidr) -ne 0 ]; then singleblock=$cidr fi done echo echo ---------- if [ -n "$singleblock" ]; then echo "Or the following to only block the specific netblock the ip is in:" echo echo set firewall group network-group ${2:-Infiltrators} network $singleblock echo echo ---------- fi popd 1>/dev/null