citadel

My dotfiles, scripts and nix configs
git clone git://jb55.com/citadel
Log | Files | Refs | README | LICENSE

btc-ban-aws (309B)


      1 #!/usr/bin/env bash
      2 
      3 curl -s 'https://ip-ranges.amazonaws.com/ip-ranges.json' |
      4 jq -rc '.prefixes[].ip_prefix | {"jsonrpc": "1.0", "id":"aws-banscript", method: "setban", "params": [., "add", 3600]}' |
      5 jq -s  |
      6 curl -s -u rpcuser:rpcpass --data-binary @/dev/stdin -H 'content-type: text/plain' 127.0.0.1:8332