]> git.friedersdorff.com Git - max/glocker.git/commitdiff
Example of server side script to generate banned IPs
authorMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 11 Sep 2018 14:18:18 +0000 (15:18 +0100)
committerMaximilian Friedersdorff <max@friedersdorff.com>
Tue, 11 Sep 2018 14:18:18 +0000 (15:18 +0100)
banned.sh [new file with mode: 0755]

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