summaryrefslogtreecommitdiffstats
path: root/torblock.sh
diff options
context:
space:
mode:
Diffstat (limited to 'torblock.sh')
-rwxr-xr-xtorblock.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/torblock.sh b/torblock.sh
index 5638a80..a026556 100755
--- a/torblock.sh
+++ b/torblock.sh
@@ -3,7 +3,11 @@
set -e
get_ips() {
- curl -sSL "https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$(curl icanhazip.com)" | sed '/^#/d' | grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
+ curl -sSL "https://check.torproject.org/cgi-bin/TorBulkExitList.py?ip=$(curl -s icanhazip.com | grep_ip)" | sed '/^#/d' | grep_ip
+}
+
+grep_ip() {
+ grep -Eo "([0-9]{1,3}[\.]){3}[0-9]{1,3}"
}
ipset flush tor || true