IPv4gw=$(ip route show | awk '/default\ via/ {print $3}')
@ -164,6 +163,8 @@ commands["Backing up the lighttpd config file"]="sudo mv /etc/lighttpd/lighttpd.
commands["Backing up the default Web page"]="sudo mv /var/www/html/index.lighttpd.html /var/www/html/index.lighttpd.orig";echoes+=("Backing up the default Web page")
commands["Installing the dnsmasq config file"]="sudo curl -o /etc/dnsmasq.conf https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/dnsmasq.conf";echoes+=("Installing the dnsmasq config file")
commands["Installing the lighttpd config file"]="sudo curl -o /etc/lighttpd/lighttpd.conf https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/lighttpd.conf";echoes+=("Installing the lighttpd config file")
commands["Making a directory for the Web interface"]="sudo mkdir /var/www/html/pihole";echoes+=("Making a directory for the Web interface")
commands["Installing a blank HTML page to take place of ads"]="sudo curl -o /var/www/html/pihole/index.html https://raw.githubusercontent.com/jacobsalmela/pi-hole/master/advanced/index.html";echoes+=("Installing a blank HTML page to take place of ads")
@ -182,7 +183,7 @@ commands["Entering the event horizion"]="sudo /usr/local/bin/gravity.sh"; echoes
commands["Rebooting"]="sudo service networking restart";echoes+=("Restarting networking...")
# Everything in the parentheses is part of displaying the progress bar
(
#(
# Get total number of commands to be run from the array
n=${#commands[*]};
# Set counter to increase every time a loop completes
@ -205,10 +206,10 @@ XXX
EOF
# Execute the command in the background (hidden from the user, not actually a background process)
${commands[${echoes[$k]}]} > $tmpLog 2>&1
${commands[${echoes[$k]}]}| tee $tmpLog
clear
done
sudo mv $tmpLog$instalLogLoc$instalLogLoc
# As the loop is progressing, the output is sent to whiptail to be displayed to the user
)|
whiptail --title "Opening your Pi-hole..." --gauge "Please wait..."$r$c0