]> git.friedersdorff.com Git - max/glocker.git/blobdiff - banned.sh
Example of server side script to generate banned IPs
[max/glocker.git] / banned.sh
diff --git a/banned.sh b/banned.sh
new file mode 100755 (executable)
index 0000000..7d74840
--- /dev/null
+++ b/banned.sh
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+# Google IPs
+echo '!gas15169' | nc whois.radb.net 43 | tail -n +2 | head -n -1 >> /var/www/www.friedersdorff.com/public_html/.banned.tmp
+
+# Facebook IPs
+echo '!gas32934' | nc whois.radb.net 43 | tail -n +2 | head -n -1 >> /var/www/www.friedersdorff.com/public_html/.banned.tmp
+
+# Twitter IPs
+echo '!gas13414' | nc whois.radb.net 43 | tail -n +2 | head -n -1 >> /var/www/www.friedersdorff.com/public_html/.banned.tmp
+
+mv /var/www/www.friedersdorff.com/public_html/.banned.tmp /var/www/www.friedersdorff.com/public_html/.banned