Skip to content

Instantly share code, notes, and snippets.

@fanthos
Last active July 11, 2017 08:52
Show Gist options
  • Save fanthos/fcb6dbcdf50928f0540d4be68cadc01f to your computer and use it in GitHub Desktop.
Save fanthos/fcb6dbcdf50928f0540d4be68cadc01f to your computer and use it in GitHub Desktop.
hosts update
#!/bin/sh
HOSTS="/tmp/hosts/remote1"
MAIN="https://raw.githubusercontent.com/racaljk/hosts/master/hosts"
MIRROR="https://coding.net/u/scaffrey/p/hosts/git/raw/master/hosts"
TEMPFILE="/tmp/hostsupdate.swp"
USEDBLOCKS="Android|Amazon AWS|Apkpure|Archive|Box.com|BundleStars|Cloudfront.net|Disqus|Dropbox|DuckDuckGo|Facebook|Github|Google|Gmail web|gstatic|Googleapis|Googleusercontent|imgur|Instagram|MEGA|OneDrive|pinterest|RawGit|Tor|W3schools|Wikipedia|XboxLive"
wget -O $TEMPFILE $MAIN
awk "/# (${USEDBLOCKS}) Start/,/#.+End/" $TEMPFILE > $HOSTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment