mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
vpn-policy-routing: initial release
Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
# This file is heavily based on code from https://github.com/Xentrk/netflix-vpn-bypass/blob/master/IPSET_Netflix.sh
|
||||
|
||||
TARGET_IPSET='wan'
|
||||
TARGET_ASN='2906'
|
||||
TARGET_URL="https://ipinfo.io/AS${TARGET_ASN}"
|
||||
TARGET_FNAME="/var/tmp_AS${TARGET_ASN}"
|
||||
|
||||
curl "$TARGET_URL" 2>/dev/null | grep -E "a href.*${TARGET_ASN}\/" | grep -v ":" | sed "s/^.*<a href=\"\/AS${TARGET_ASN}\///; s/\" >//" > "$TARGET_FNAME"
|
||||
awk -v ipset="$TARGET_IPSET" '{print "add " ipset " " $1}' "$TARGET_FNAME" | ipset restore -!
|
||||
rm -f "$TARGET_FNAME"
|
||||
Reference in New Issue
Block a user