Skip to content

Instantly share code, notes, and snippets.

@stackia
Created April 18, 2017 11:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stackia/7acc54650f833883e03d4f13357b6d34 to your computer and use it in GitHub Desktop.
Save stackia/7acc54650f833883e03d4f13357b6d34 to your computer and use it in GitHub Desktop.
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