The changes to the gravity script check for a temp file containing the
static address set during the install. I need to verify it works so I
have to change the URL. I will change it back before merging with
master.
Created a function to set a static IP address.
I also sent STDOUT and STDERR to /dev/null so it doesn't mangle the
progress bar. When the device reboots, it still gets mangled a bit
(via ssh).
The ellipses cause errors, so they were removed.
I was on the right track with the associate array, but it would
previously execute the commands out of order. Following directions
from the URL in the comments, I made another array that helps keep the
array in the order.
This is a large update that helps users install the Pi-hole a bit
easier by using some dialog windows and also letting the user set a
static IP (I still need to figure out how to actually set the address
in the system, but everything else having to do with the install script
works).
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.
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.
Detects if the Pi had an original Pi-hole by looking for adList.conf.
If it exists, it backs up all the files to /etc/pihole/original. Then,
the script continues as normal and creates the new files. This helps
ensure that /etc/hosts and /etc/dnsmasq.d/adList.conf are not being
used simultaneously.