executable_block-ip 356 B

123456789101112131415161718192021
  1. #!/usr/bin/env bash
  2. # Block on shared SERVER specific IP-ADDRESS
  3. # shellcheck disable=SC2068
  4. if [[ -z $1 ]]; then
  5. echo "block-ip WEB IP-ADDRESSES"
  6. fi
  7. web="$1"
  8. if [[ $web != web* ]]; then
  9. web="web$web"
  10. elif [[ $web == *s ]]; then
  11. web=${web%s}
  12. fi
  13. for ip in ${@:1}; do
  14. curl -s -i -XPUT "$web/ip-filter/$ip?ttl=7200&action=setCookie"
  15. done