Merge pull request #123 from adren/patch-3
improve generation of block file (Tor exit nodes)
This commit is contained in:
commit
15f6d0a32a
@ -15,13 +15,9 @@ elif [ -S /tmp/autoconf.sock ] ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# generate the new conf
|
# generate the new conf
|
||||||
curl -s "https://iplists.firehol.org/files/tor_exits.ipset" | grep -v "^\#.*" |
|
curl -s "https://iplists.firehol.org/files/tor_exits.ipset" | \
|
||||||
while read entry ; do
|
grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$") \
|
||||||
check=$(echo $entry | grep -E "^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/?[0-9]*$")
|
sed 's/^/deny /;s/$/;/' > /tmp/block-tor-exit-node.conf
|
||||||
if [ "$check" != "" ] ; then
|
|
||||||
echo "deny ${entry};" >> /tmp/block-tor-exit-node.conf
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# check if we have at least 1 line
|
# check if we have at least 1 line
|
||||||
lines="$(wc -l /tmp/block-tor-exit-node.conf | cut -d ' ' -f 1)"
|
lines="$(wc -l /tmp/block-tor-exit-node.conf | cut -d ' ' -f 1)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user