This seems to be the more appropriate URL:
http://hosts-file.net/ad_servers.txt.
I compared it to the original URL using opendiff and they are exactly
the same.
Checks if script is running as root, non-root, or sudo. For root, it sets SUDO variable to nothing and the script runs. If it's not root, then it checks to see if sudo is installed. If it is installed, then it sets SUDO variable to 'sudo' and the script runs. If it is not root and sudo is not installed, then the user does not have sufficient privileges to run the installer and it exits.
Checks if script is running as root, non-root, or sudo. For root, it sets SUDO variable to nothing and the script runs. If it's not root, then it checks to see if sudo is installed. If it is installed, then it sets SUDO variable to 'sudo' and the script runs. If it is not root and sudo is not installed, then the user does not have sufficient privileges to run the script and it exits.
When gravity.sh is run as the root user, it errors out on the sudo command.
These changes make the script check to see if it is invoked by the root and sets the sudo variable to handle root and non-root runs.
lighttpd in Jessie uses /var/www/html for the root folder, so in order
to only edit one lightpd.conf file, the installer will create the
correct directory even if not being run on Jessie.
Match domain exactly instead of partially.
Gather list of domains to minimize number of times that hosts file must be enumerated.
Only add domain to whitelist if it isn't already present.
In my case there had been no whitespace in piholeIP (I configured it statically because 'hostname -I' returns multiple IP addresses, which ends in errornous hosts file), so it's more safe to add one between IP and hostname.
Further, I removed the obsolete latentBlacklist variable.
This adds in some back end improvements for better debugging. It also
allows you to access the Web interface, while you are connected to the
Pi-hole, which resolves#31
Since the version of lighted in Jessie moved the default folder to
/var/www/html, I am going to make it the same for wheezy for better
compatibility.
Also removed spaces
Due to so many users having issues with this list blocking legitimate
domains such as microsoft.com, apple.com, xkcd.com and more, I am
turning it off by default. While this drastically reduces the amount
of domains blocked, ad-blocking performance still seems to function
quite well.
Long-time users can simply uncomment the list, but this will make it so
new users have a more pleasant experience.
If you already have the mahakala list, you will need to remove it first
with this command:
sudo rm /etc/pihole/list.2.adblock.mahakala.is.domains
There are a few other lists I am looking at including, but this will
provide an immediate fix.
I'm not 100% sure if you can add multiple IP addresses to one domain on
a single line, so I just broke it up into two. It makes the file
bigger and longer, but I'll have to see how it works
Due to users having issues with the IP not being entered properly, I am restoring the original way to store `piholeIP` until a better solution can be formed.