| 123456789101112131415161718 |
- #!/bin/bash
- ((EUID == 0 )) || { echo "Need root"; exit 1; }
- set -euo pipefail
- CONFD=/etc/e-router
- source $CONFD/config
- tmp=$(mktemp)
- trap "/bin/rm -f ${tmp}" EXIT SIGHUP SIGINT SIGTERM
- curl -f -s -S -m 60 -o $tmp "https://www.badips.com/get/list/${banservice}/${banlevel}?age=${rangecheck}"
- while read -r ip ; do
- ipset -! add ${banset} ${ip} timeout $banttl
- done < $tmp
- curl -f -s -S -m 60 -o $tmp "http://api.blocklist.de/getlast.php?time=3600&service=all"
- while read -r ip ; do
- ipset -! add ${banset} ${ip} timeout $banttl
- done < $tmp
|