Skip to content

Instantly share code, notes, and snippets.

@creamidea
Last active May 8, 2021 15:01
Show Gist options
  • Save creamidea/f3a87ba95f0338cac29a9376995c82ba to your computer and use it in GitHub Desktop.
Save creamidea/f3a87ba95f0338cac29a9376995c82ba to your computer and use it in GitHub Desktop.
#!/bin/sh
echo generating...
curl 'http://ftp.apnic.net/apnic/stats/apnic/delegated-apnic-latest' | grep ipv4 | grep CN | awk -F\| '{ printf("%s/%d\n", $4, 32-log($5)/log(2)) }' > /tmp/chnroute.txt && echo "chnroute.txt generated" || exit 0
echo copying...
cp /tmp/chnroute.txt /etc/storage/DEADC0DE/chnroute/
echo cleaning...
rm -rf /tmp/chnroute.txt
echo DONE
# 0 3 */1 * * /xx/update_chnroute.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment