+ basename IPSET_Netflix.sh
+ PROGNAME=IPSET_Netflix.sh
+ LOCKFILE_DIR=/tmp
+ LOCK_FD=200
+ main
+ lock IPSET_Netflix.sh
+ local prefix=IPSET_Netflix.sh
+ local fd=200
+ local lock_file=/tmp/IPSET_Netflix.sh.lock
+ eval exec 200>/tmp/IPSET_Netflix.sh.lock
+ exec
+ flock -n 200
+ return 0
+ [ ! -s /jffs/shared-SelectiveRouting-whitelist ]
+ ipset list -n NETFLIX
+ [ NETFLIX != NETFLIX ]
+ ipset -L NETFLIX
+ awk { if (FNR == 7) print $0 }
+ awk {print $4 }
+ [ 106 -eq 0 ]
+ Chk_Entware jq
+ local READY=1
+ local ENTWARE=opkg
+ ENTWARE_UTILITY=
+ local MAX_TRIES=30
+ [ ! -z ]
+ [ ! -z jq ]
+ echo jq
+ grep -E ^[0-9]+$
+ [ -z ]
+ ENTWARE_UTILITY=jq
+ local TRIES=0
+ [ 0 -lt 30 ]
+ which opkg
+ [ ! -z /opt/bin/opkg ]
+ opkg -v
+ grep -o version
+ [ version == version ]
+ [ ! -z jq ]
+ opkg list-installed jq
+ [ ! -z jq - 1.5-2b ]
+ READY=0
+ break
+ return 0
+ ipset list -n AMAZONAWS
+ [ AMAZONAWS != AMAZONAWS ]
+ ipset -L AMAZONAWS
+ awk { if (FNR == 7) print $0 }
+ awk {print $4 }
+ [ 0 -eq 0 ]
+ [ ! -s /opt/tmp/AmazonAWS ]
+ download_AmazonAWS
+ wget
https://ip-ranges.amazonaws.com/ip-ranges.json -O /opt/tmp/ip-ranges.json
--2018-07-31 17:22:11--
https://ip-ranges.amazonaws.com/ip-ranges.json
Resolving ip-ranges.amazonaws.com... 13.35.78.51, 13.35.78.128, 13.35.78.100, ...
Connecting to ip-ranges.amazonaws.com|13.35.78.51|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 174812 (171K) [application/json]
Saving to: '/opt/tmp/ip-ranges.json'
/opt/tmp/ip-ranges.json 100%[==============================================================================================>] 170.71K 491KB/s in 0.3s
2018-07-31 17:22:12 (491 KB/s) - '/opt/tmp/ip-ranges.json' saved [174812/174812]
+ jq -r .prefixes | .[].ip_prefix
+ rm -rf /opt/tmp/ip-ranges.json
+ find /opt/tmp/ -name AmazonAWS -mtime +1 -print
+ [ = /opt/tmp/AmazonAWS ]
+ awk {print "add AMAZONAWS " $1} /opt/tmp/AmazonAWS
+ ipset restore -!
+ ip rule del prio 9990
+ ip rule add from 0/0 fwmark 0x7000/0x7000 table main prio 9990
+ iptables -t mangle -D PREROUTING -i br0 -p tcp -m set --match-set NETFLIX dst,dst -j MARK --set-mark 0x7000/0x7000
+ iptables -t mangle -A PREROUTING -i br0 -p tcp -m set --match-set NETFLIX dst,dst -j MARK --set-mark 0x7000/0x7000
+ iptables -t mangle -D PREROUTING -i br0 -p tcp -m set --match-set AMAZONAWS dst,dst -j MARK --set-mark 0x7000/0x7000
+ iptables -t mangle -A PREROUTING -i br0 -p tcp -m set --match-set AMAZONAWS dst,dst -j MARK --set-mark 0x7000/0x7000
+ basename IPSET_Netflix.sh
+ logger -t (IPSET_Netflix.sh) 5973 Completed Script Execution