Skip to content

Instantly share code, notes, and snippets.

@jakevis
Last active October 2, 2019 19:33
Show Gist options
  • Save jakevis/39896ff5d2b71436c22a to your computer and use it in GitHub Desktop.
Save jakevis/39896ff5d2b71436c22a to your computer and use it in GitHub Desktop.
#!/bin/sh
# the full path of the file we create
filename=addTorIPs.rsc
rm $filename
# remove the comment if you want to use the List of All Current Tor Server IP Addresses
url=http://torstatus.blutmagie.de/ip_list_all.php/Tor_ip_list_ALL.csv
# remove the comment if you want to use the List of All Current Tor Server Exit Node IP Addresses
#url=http://torstatus.blutmagie.de/ip_list_exit.php/Tor_ip_list_EXIT.csv
echo "# This scrip adds Tor IP addresses to an address-list (list created: $(date))" > $filename
echo "/ip firewall address-list" >> $filename
wget -q -O - $url | sort -u | awk --posix '/^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/ { print "add list=addressListTor dynamic=yes address="$1" " ;}' >> $filename
ssh outlaw "/ip firewall address-list remove [/ip firewall address-list find list=addressListTor]"
scp $filename outlaw:/
ssh outlaw "/import file-name=addTorIPs.rsc"
@jakevis
Copy link
Author

jakevis commented Jun 20, 2015

For use with Mikrotik routers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment