#!/bin/bash export HT=/path/to/webroot/.htaccess export URL=http\:\/\/anonymizer\.blutmagie\.de\:2505\/ip_list_exit.php\/Tor_ip_list_EXIT\.csv wget ${URL} 2>/dev/null # turn off dir listings; you can leave out if done globally # you should ideally disable more than just this echo "Options -Indexes" > ${HT} # put your 403 error document in 403.html echo "ErrorDocument 403 /403.html" >> ${HT} echo "order allow,deny" >> ${HT} for ipaddr in `cat Tor_ip_list_EXIT.csv`; do echo "deny from ${ipaddr}" >> ${HT} done echo "allow from all" >> ${HT} rm Tor_ip_list_EXIT.csv