Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
update-chnroute.sh
#!/bin/sh
RULES=$(wget -O- 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | awk -F\| '/CN\|ipv4/ { printf("%s/%d\n", $4, 32-log($5)/log(2)) }')
if [ ! -z "$RULES" ]; then
echo "$RULES" > /etc/chinadns_chnroute.txt
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.