|
@@ -7,12 +7,12 @@ source $CONFD/config
|
|
|
tmp=$(mktemp)
|
|
tmp=$(mktemp)
|
|
|
|
|
|
|
|
while read -r asn ; do
|
|
while read -r asn ; do
|
|
|
- [[ "$asn" =~ ^[0-9]{1,}$ ]] || continue
|
|
|
|
|
|
|
+ [[ "$asn" =~ ^AS[0-9]{1,}$ ]] || continue
|
|
|
whois -h whois.radb.net -- -K -T route -i origin AS${asn} >> $tmp
|
|
whois -h whois.radb.net -- -K -T route -i origin AS${asn} >> $tmp
|
|
|
done < $CONFD/WHITE.asn
|
|
done < $CONFD/WHITE.asn
|
|
|
|
|
|
|
|
grep -Eo "([0-9.]+){4}/[0-9]+" $tmp | while read -r net ; do
|
|
grep -Eo "([0-9.]+){4}/[0-9]+" $tmp | while read -r net ; do
|
|
|
ipset -! add $whiteset $net timeout $routettl
|
|
ipset -! add $whiteset $net timeout $routettl
|
|
|
-done
|
|
|
|
|
|
|
+done
|
|
|
|
|
|
|
|
trap "/bin/rm -f ${tmp}" EXIT SIGHUP SIGINT SIGTERM
|
|
trap "/bin/rm -f ${tmp}" EXIT SIGHUP SIGINT SIGTERM
|