Skip to content

Instantly share code, notes, and snippets.

@tolgahanakgun
Created May 10, 2020 17:05
Show Gist options
  • Save tolgahanakgun/4a53b807f015aeba8ba9a0f08151574e to your computer and use it in GitHub Desktop.
Save tolgahanakgun/4a53b807f015aeba8ba9a0f08151574e to your computer and use it in GitHub Desktop.
#!/bin/bash
# download hosts file
wget -O /opt/adblock/hostfiles/someonewhocares.hosts https://someonewhocares.org/hosts/zero/hosts
wget -O /opt/adblock/hostfiles/winhelp2002.hosts http://winhelp2002.mvps.org/hosts.txt
wget -O /opt/adblock/hostfiles/tgccloud.hosts https://tgc.cloud/downloads/hosts.txt
wget -O /opt/adblock/hostfiles/stevensblack.hosts https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
wget -O /opt/adblock/hostfiles/hblock.hosts https://hblock.molinero.dev/hosts
wget -O /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts https://raw.githubusercontent.com/x0uid/SpotifyAdBlock/master/hosts
wget -O /opt/adblock/hostfiles/spotify_saminnet_spotify_adblock_script.hosts https://raw.githubusercontent.com/saminnet/spotify-adblock-script/master/block.txt
# remove update address from blacklist
sed -i '/upgrade.spotify.com/d' /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts
sed -i '/www.spotify-desktop.com/d' /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts
sed -i '/sto3-accesspoint-a88.sto3.spotify.net/d' /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts
sed -i '/upgrade.scdn.co/d' /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts
sed -i '/beta.spotify.map.fastly.net/d' /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts
sed -i '/prod.spotify.map.fastlylb.net/d' /opt/adblock/hostfiles/spotify_x0uid_spotifyablock.hosts
# restart the dnsmasq service for the updated hosts file
service dnsmasq restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment