From 2f384525652e3e617bfd5e13e9ed09b0165a9176 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Thu, 31 Mar 2022 12:03:17 -0700 Subject: [PATCH] Wrap touch calls with if/then guards for Buster docker. Signed-off-by: Dan Schaper --- automated install/basic-install.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 1e004b8b..99e4dc47 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -1128,8 +1128,10 @@ chooseBlocklists() { appendToListsFile "${choice}" done # Create an empty adList file with appropriate permissions. - touch "${adlistFile}" - chmod 644 "${adlistFile}" + if [ ! -f "${adlistFile}" ]; then + touch "${adlistFile}" + chmod 644 "${adlistFile}" + fi } # Accept a string parameter, it must be one of the default lists @@ -1330,8 +1332,10 @@ installConfigs() { # and copy in the config file Pi-hole needs install -D -m 644 -T ${PI_HOLE_LOCAL_REPO}/advanced/${LIGHTTPD_CFG} "${lighttpdConfig}" # Make sure the external.conf file exists, as lighttpd v1.4.50 crashes without it - touch /etc/lighttpd/external.conf - chmod 644 /etc/lighttpd/external.conf + if [ ! -f /etc/lighttpd/external.conf ]; then + touch /etc/lighttpd/external.conf + chmod 644 /etc/lighttpd/external.conf + fi # If there is a custom block page in the html/pihole directory, replace 404 handler in lighttpd config if [[ -f "${PI_HOLE_BLOCKPAGE_DIR}/custom.php" ]]; then sed -i 's/^\(server\.error-handler-404\s*=\s*\).*$/\1"\/pihole\/custom\.php"/' "${lighttpdConfig}"