commit c5e41024afce52516868dc6ec14e90ed7b006b43
parent b202c2880c52489866c29e02c45d18727c6e830a
Author: William Casarin <jb55@jb55.com>
Date: Thu, 8 Oct 2020 12:27:37 -0700
bin/btc-ban-aws: init
Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/bin/btc-ban-aws b/bin/btc-ban-aws
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+curl -s 'https://ip-ranges.amazonaws.com/ip-ranges.json' |
+jq -rc '.prefixes[].ip_prefix | {"jsonrpc": "1.0", "id":"aws-banscript", method: "setban", "params": [., "add", 3600]}' |
+jq -s |
+curl -s -u rpcuser:rpcpass --data-binary @/dev/stdin -H 'content-type: text/plain' 127.0.0.1:8332