From 7872f68a45145b713971bab9af6cc56860a8fbf6 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 16 Dec 2016 13:13:35 +0100 Subject: [PATCH] Only try to remove parts inthe file if the file already exists --- automated install/basic-install.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 4744d7d5..0e82cb31 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -873,7 +873,9 @@ configureFirewall() { finalExports() { # 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}" + if [ -e "${setupVars}" ]; then + 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}" + fi { echo "PIHOLE_INTERFACE=${PIHOLE_INTERFACE}" echo "IPV4_ADDRESS=${IPV4_ADDRESS}"