From ec8c848106841c0e7900d7772025c99c30364d3f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 16 Dec 2016 12:53:00 +0100 Subject: [PATCH] Don't kill already existing setupVars.conf on update (and fresh install) --- automated install/basic-install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9464d03b..4744d7d5 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -872,10 +872,8 @@ configureFirewall() { } finalExports() { - #If it already exists, lets overwrite it with the new values. - if [[ -f ${setupVars} ]]; then - rm ${setupVars} - fi + # Update variables in setupVars.conf file + sed -i.update.bak '/PIHOLE_DOMAIN/d;/IPV4_ADDRESS/d;/IPV6_ADDRESS/d;/PIHOLE_DNS_1/d;/PIHOLE_DNS_2/d;/QUERY_LOGGING/d;' "${setupVars}" { echo "PIHOLE_INTERFACE=${PIHOLE_INTERFACE}" echo "IPV4_ADDRESS=${IPV4_ADDRESS}"