Skip to content

Instantly share code, notes, and snippets.

@0xRake
Created June 4, 2020 07:37
Show Gist options
  • Save 0xRake/141dd4b20170f754270d2fc1a5ab706b to your computer and use it in GitHub Desktop.
Save 0xRake/141dd4b20170f754270d2fc1a5ab706b to your computer and use it in GitHub Desktop.
/config/user-data
#!/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