Created
June 4, 2020 07:37
-
-
Save 0xRake/141dd4b20170f754270d2fc1a5ab706b to your computer and use it in GitHub Desktop.
/config/user-data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ad_list_url=”http://pgl.yoyo.org/adservers/serverlist.php?hostformat=dnsmasq&showintro=0&mimetype=plaintext"#The IP address below should point to the IP of your router or to 0.0.0.0 | |
pixelserv_ip=”0.0.0.0" | |
ad_file=”/etc/dnsmasq.d/dnsmasq.adlist.conf” | |
temp_ad_file=”/etc/dnsmasq.d/dnsmasq.adlist.conf.tmp”curl -s $ad_list_url | sed “s/127\.0\.0\.1/$pixelserv_ip/” > $temp_ad_fileif [ -f “$temp_ad_file” ] | |
then | |
sed -i -e ‘/googleadservices\.com/d’ $temp_ad_file | |
sed -i -e ‘/doubleclick\.net/d’ $temp_ad_file | |
sed -i -e ‘/awin1\.com/d’ $temp_ad_file | |
mv $temp_ad_file $ad_file | |
else | |
echo “Error building the ad list, please try again.” | |
exit | |
fi/etc/init.d/dnsmasq force-reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment