```
#!/bin/bash
TOR_LIST=`curl https://check.torproject.org/torbulkexitlist`
ALREADY_BLOCKED=`ufw status | grep 'TOR NODE' | awk '{print $3}'`
for IP in $TOR_LIST
do
if [[ $ALREADY_BLOCKED == *$IP* ]]; then
echo "Already blocking $IP"
continue
fi
echo "Blocking $IP"
ufw insert 1 deny from $IP to any comment 'TOR NODE'
done
```
#nowplaying