* Do not activate disabled lighttpd upon update
* Fixes#1362
* Use systemctl when available
* Move `finalexports` to the very end of the install script
set value of LIGHTTPD_ENABLED to 1 or 0 depending on whether or not lighttpd is enabled or disabled.
actually save LIGHTTPD_ENABLED value to setupvars.conf
Signed-off-by: Adam Warner <adamw@rner.email>
* add [[ -z "${LIGHTTPD_ENABLED}" ]] back in!
Signed-off-by: Adam Warner <adamw@rner.email>
* Ensure "Loaded:" is the line being checked
* Colourise disabled lighttpd message
* Prevent disabled lighttpd triggering error
* change of plan, don't need that [[ -z "${LIGHTTPD_ENABLED}" ]]
Signed-off-by: Adam Warner <adamw@rner.email>
sed -i.update.bak '/PIHOLE_INTERFACE/d;/IPV4_ADDRESS/d;/IPV6_ADDRESS/d;/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/QUERY_LOGGING/d;/INSTALL_WEB/d;'"${setupVars}"
sed -i.update.bak '/PIHOLE_INTERFACE/d;/IPV4_ADDRESS/d;/IPV6_ADDRESS/d;/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/QUERY_LOGGING/d;/INSTALL_WEB/d;/LIGHTTPD_ENABLED/d;'"${setupVars}"
fi
# echo the information to the user
{
@ -1497,6 +1496,7 @@ finalExports() {
echo"PIHOLE_DNS_2=${PIHOLE_DNS_2}"
echo"QUERY_LOGGING=${QUERY_LOGGING}"
echo"INSTALL_WEB=${INSTALL_WEB}"
echo"LIGHTTPD_ENABLED=${LIGHTTPD_ENABLED}"
}>> "${setupVars}"
# Look for DNS server settings which would have to be reapplied
@ -1585,9 +1585,6 @@ installPihole() {
FTLdetect ||echo -e "${CROSS} FTL Engine not installed."
# Configure the firewall
configureFirewall
# Run the final exports
finalExports
#runGravity
}
# At some point in the future this list can be pruned, for now we'll need it to ensure updates don't break.
@ -1621,8 +1618,8 @@ updatePihole() {
installLogrotate
# Detect if FTL is installed
FTLdetect ||echo -e "${CROSS} FTL Engine not installed."
finalExports #re-export setupVars.conf to account for any new vars added in new versions
#runGravity
}
@ -2052,10 +2049,24 @@ main() {
enable_service dnsmasq
# If the Web server was installed,
if[[${INSTALL_WEB}==true]];then
# enable it
start_service lighttpd
enable_service lighttpd
if[["${INSTALL_WEB}"==true]];then
# Check to see if lighttpd was already set to run on reboot