From 48c59cb6cf66546a7b8f2f7a8ca1ccc0bc51281e Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Sun, 6 Apr 2025 14:18:52 +0100 Subject: [PATCH] In ./automated install/uninstall.sh line 14: readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") ^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In ./advanced/Scripts/update.sh line 39: readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") ^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In ./advanced/Scripts/updatecheck.sh line 45: readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") ^-----------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. Signed-off-by: Adam Warner --- advanced/Scripts/update.sh | 3 ++- advanced/Scripts/updatecheck.sh | 3 ++- automated install/uninstall.sh | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index ed038db9..d7441105 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -36,7 +36,8 @@ source "${PI_HOLE_INSTALL_DIR}/utils.sh" # getFTLConfigValue() sourced from utils.sh # Honour configured paths for the web application. -readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") +ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") +readonly ADMIN_INTERFACE_DIR GitCheckUpdateAvail() { local directory diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index b64917a2..6cd485eb 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -42,7 +42,8 @@ function get_remote_hash() { # shellcheck disable=SC1091 . /opt/pihole/utils.sh -readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") +ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") +readonly ADMIN_INTERFACE_DIR # Remove the below three legacy files if they exist rm -f "/etc/pihole/GitHubVersions" diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 28917bca..9020d275 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -11,7 +11,8 @@ source "/opt/pihole/COL_TABLE" source "/opt/pihole/utils.sh" -readonly ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") +ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") +readonly ADMIN_INTERFACE_DIR while true; do read -rp " ${QST} Are you sure you would like to remove ${COL_WHITE}Pi-hole${COL_NC}? [y/N] " answer