From 41b1d041004c15f0b5a67a5a837d1fd63910a0bb Mon Sep 17 00:00:00 2001 From: Adam Hill Date: Mon, 6 Aug 2018 07:46:29 -0500 Subject: [PATCH] Do not delete the setting before sourcing the file :} Signed-off-by: Adam Hill --- bash_functions.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bash_functions.sh b/bash_functions.sh index b1c0475..1f3cbfe 100644 --- a/bash_functions.sh +++ b/bash_functions.sh @@ -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 {