Do not delete the setting before sourcing the file :}

Signed-off-by: Adam Hill <adam@diginc.us>
This commit is contained in:
Adam Hill 2018-08-06 07:46:29 -05:00
parent f8d37693ed
commit 41b1d04100
No known key found for this signature in database
GPG Key ID: 2193804FCA429855
1 changed files with 2 additions and 1 deletions

View File

@ -27,11 +27,12 @@ prepare_configs() {
# If the setup variable file exists,
if [[ -e "${setupVars}" ]]; then
# update the variables in the file
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_SERVER/d;/INSTALL_WEB_INTERFACE/d;/LIGHTTPD_ENABLED/d;' "${setupVars}"
local USERWEBPASSWORD="${WEBPASSWORD}"
. "${setupVars}"
# Stash and pop the user password to avoid setting the password to the hashed setupVar variable
WEBPASSWORD="${USERWEBPASSWORD}"
# Clean up old before re-writing the required 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_SERVER/d;/INSTALL_WEB_INTERFACE/d;/LIGHTTPD_ENABLED/d;' "${setupVars}"
fi
# echo the information to the user
{