mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 04:30:55 +00:00
Fix/unbreak development (#1635)
* Always process DNS and DHCP settings in installer * change where finalExports is called and where LIGHTTPD_ENABLED is set. Signed-off-by: Adam Warner <adamw@rner.email> * this may or may not work. If it does, can be functionised to reduce code duping Signed-off-by: Adam Warner <adamw@rner.email> * This will fix the tests, but break the patch Signed-off-by: Adam Warner <adamw@rner.email>
This commit is contained in:
parent
a77136bd1d
commit
c02a24cf71
@ -1499,22 +1499,20 @@ finalExports() {
|
|||||||
echo "LIGHTTPD_ENABLED=${LIGHTTPD_ENABLED}"
|
echo "LIGHTTPD_ENABLED=${LIGHTTPD_ENABLED}"
|
||||||
}>> "${setupVars}"
|
}>> "${setupVars}"
|
||||||
|
|
||||||
# Look for DNS server settings which would have to be reapplied
|
# Bring in the current settings and the functions to manipulate them
|
||||||
source "${setupVars}"
|
source "${setupVars}"
|
||||||
#
|
|
||||||
source "${PI_HOLE_LOCAL_REPO}/advanced/Scripts/webpage.sh"
|
source "${PI_HOLE_LOCAL_REPO}/advanced/Scripts/webpage.sh"
|
||||||
|
|
||||||
#
|
|
||||||
if [[ "${DNS_FQDN_REQUIRED}" != "" ]] ; then
|
if [[ "${DNS_FQDN_REQUIRED}" != "" ]] ; then
|
||||||
#
|
# Look for DNS server settings which would have to be reapplied
|
||||||
ProcessDNSSettings
|
ProcessDNSSettings
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#
|
|
||||||
if [[ "${DHCP_ACTIVE}" != "" ]] ; then
|
if [[ "${DHCP_ACTIVE}" != "" ]] ; then
|
||||||
#
|
# Look for DHCP server settings which would have to be reapplied
|
||||||
ProcessDHCPSettings
|
ProcessDHCPSettings
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install the logrotate script
|
# Install the logrotate script
|
||||||
@ -1585,6 +1583,9 @@ installPihole() {
|
|||||||
FTLdetect || echo -e " ${CROSS} FTL Engine not installed."
|
FTLdetect || echo -e " ${CROSS} FTL Engine not installed."
|
||||||
# Configure the firewall
|
# Configure the firewall
|
||||||
configureFirewall
|
configureFirewall
|
||||||
|
|
||||||
|
#update setupvars.conf with any variables that may or may not have been changed during the install
|
||||||
|
finalExports
|
||||||
}
|
}
|
||||||
|
|
||||||
# At some point in the future this list can be pruned, for now we'll need it to ensure updates don't break.
|
# At some point in the future this list can be pruned, for now we'll need it to ensure updates don't break.
|
||||||
@ -1619,6 +1620,8 @@ updatePihole() {
|
|||||||
# Detect if FTL is installed
|
# Detect if FTL is installed
|
||||||
FTLdetect || echo -e " ${CROSS} FTL Engine not installed."
|
FTLdetect || echo -e " ${CROSS} FTL Engine not installed."
|
||||||
|
|
||||||
|
#update setupvars.conf with any variables that may or may not have been changed during the install
|
||||||
|
finalExports
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2034,6 +2037,13 @@ main() {
|
|||||||
fi
|
fi
|
||||||
install_dependent_packages DEPS[@]
|
install_dependent_packages DEPS[@]
|
||||||
|
|
||||||
|
if [[ -x "$(command -v systemctl)" ]]; then
|
||||||
|
# Value will either be 1, if true, or 0
|
||||||
|
LIGHTTPD_ENABLED=$(systemctl is-enabled lighttpd | grep -c 'enabled' || true)
|
||||||
|
else
|
||||||
|
# Value will either be 1, if true, or 0
|
||||||
|
LIGHTTPD_ENABLED=$(service lighttpd status | awk '/Loaded:/ {print $0}' | grep -c 'enabled' || true)
|
||||||
|
fi
|
||||||
|
|
||||||
# Install and log everything to a file
|
# Install and log everything to a file
|
||||||
installPihole | tee ${tmpLog}
|
installPihole | tee ${tmpLog}
|
||||||
@ -2055,6 +2065,14 @@ main() {
|
|||||||
fi
|
fi
|
||||||
install_dependent_packages DEPS[@]
|
install_dependent_packages DEPS[@]
|
||||||
|
|
||||||
|
if [[ -x "$(command -v systemctl)" ]]; then
|
||||||
|
# Value will either be 1, if true, or 0
|
||||||
|
LIGHTTPD_ENABLED=$(systemctl is-enabled lighttpd | grep -c 'enabled' || true)
|
||||||
|
else
|
||||||
|
# Value will either be 1, if true, or 0
|
||||||
|
LIGHTTPD_ENABLED=$(service lighttpd status | awk '/Loaded:/ {print $0}' | grep -c 'enabled' || true)
|
||||||
|
fi
|
||||||
|
|
||||||
updatePihole | tee ${tmpLog}
|
updatePihole | tee ${tmpLog}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -2080,16 +2098,6 @@ main() {
|
|||||||
|
|
||||||
# If the Web server was installed,
|
# If the Web server was installed,
|
||||||
if [[ "${INSTALL_WEB}" == true ]]; then
|
if [[ "${INSTALL_WEB}" == true ]]; then
|
||||||
# Check to see if lighttpd was already set to run on reboot
|
|
||||||
if [[ "${useUpdateVars}" == true ]]; then
|
|
||||||
if [[ -x "$(command -v systemctl)" ]]; then
|
|
||||||
# Value will either be 1, if true, or 0
|
|
||||||
LIGHTTPD_ENABLED=$(systemctl is-enabled lighttpd | grep -c 'enabled' || true)
|
|
||||||
else
|
|
||||||
# Value will either be 1, if true, or 0
|
|
||||||
LIGHTTPD_ENABLED=$(service lighttpd status | awk '/Loaded:/ {print $0}' | grep -c 'enabled' || true)
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "${LIGHTTPD_ENABLED}" == "1" ]]; then
|
if [[ "${LIGHTTPD_ENABLED}" == "1" ]]; then
|
||||||
start_service lighttpd
|
start_service lighttpd
|
||||||
@ -2144,8 +2152,7 @@ main() {
|
|||||||
# Display where the log file is
|
# Display where the log file is
|
||||||
echo -e "\n ${INFO} The install log is located at: /etc/pihole/install.log
|
echo -e "\n ${INFO} The install log is located at: /etc/pihole/install.log
|
||||||
${COL_LIGHT_GREEN}${INSTALL_TYPE} Complete! ${COL_NC}"
|
${COL_LIGHT_GREEN}${INSTALL_TYPE} Complete! ${COL_NC}"
|
||||||
#update setupvars.conf with any variables that may or may not have been changed during the install
|
|
||||||
finalExports
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
|
Loading…
Reference in New Issue
Block a user