You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

11 lines
472 B

  1. #!/bin/sh
  2. # This file is heavily based on code from https://github.com/Xentrk/netflix-vpn-bypass/blob/master/IPSET_Netflix.sh
  3. TARGET_IPSET='wan'
  4. TARGET_URL="https://ip-ranges.amazonaws.com/ip-ranges.json"
  5. TARGET_FNAME="/var/tmp_aws_ip_ranges"
  6. curl "$TARGET_URL" 2>/dev/null | grep "ip_prefix" | sed 's/^.*\"ip_prefix\": \"//; s/\",//' > "$TARGET_FNAME"
  7. awk -v ipset="$TARGET_IPSET" '{print "add " ipset " " $1}' "$TARGET_FNAME" | ipset restore -!
  8. rm -f "$TARGET_FNAME"