From 3a9b9c027efcb53d239fc66b2ba8545c01a0e59e Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Fri, 4 Apr 2025 23:50:51 +0100 Subject: [PATCH] In ./pihole line 20: source "${colfile}" ^----------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location. In ./pihole line 23: source "${utilsfile}" ^------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location. In ./pihole line 27: source "${apifile}" ^----------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location. In ./pihole line 34: source "${versionsfile}" ^---------------^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location. In ./pihole line 251: local timer="$(echo "${data}"| jq --raw-output '.timer' )" ^---^ SC2155 (warning): Declare and assign separately to avoid masking return values. In ./pihole line 255: local str="Pi-hole $(echo "${data}" | jq --raw-output '.blocking')${extra}" ^-^ SC2155 (warning): Declare and assign separately to avoid masking return values. In ./pihole line 378: local logging_enabled=$(getFTLConfigValue dns.queryLogging) ^-------------^ SC2155 (warning): Declare and assign separately to avoid masking return values. In ./pihole line 385: readonly LOGFILE=$(getFTLConfigValue files.log.dnsmasq) ^-----^ SC2155 (warning): Declare and assign separately to avoid masking return values. Signed-off-by: Adam Warner --- pihole | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pihole b/pihole index bf662a82..efba71f0 100755 --- a/pihole +++ b/pihole @@ -9,6 +9,8 @@ # This file is copyright under the latest version of the EUPL. # Please see LICENSE file for your rights under this license. +# shellcheck disable=SC1090 + readonly PI_HOLE_SCRIPT_DIR="/opt/pihole" # PI_HOLE_BIN_DIR is not readonly here because in some functions (checkout), @@ -247,12 +249,14 @@ Time: data=$(PostFTLData "dns/blocking" "{ \"blocking\": ${1}, \"timer\": ${tt} }") # Check the response - local extra=" forever" - local timer="$(echo "${data}"| jq --raw-output '.timer' )" + local extra timer + extra=" forever" + timer="$(echo "${data}"| jq --raw-output '.timer' )" if [[ "${timer}" != "null" ]]; then extra=" for ${timer}s" fi - local str="Pi-hole $(echo "${data}" | jq --raw-output '.blocking')${extra}" + local str + str="Pi-hole $(echo "${data}" | jq --raw-output '.blocking')${extra}" # Logout from the API LogoutAPI @@ -375,14 +379,16 @@ statusFunc() { tailFunc() { # Warn user if Pi-hole's logging is disabled - local logging_enabled=$(getFTLConfigValue dns.queryLogging) + local logging_enabled + logging_enabled=$(getFTLConfigValue dns.queryLogging) if [[ "${logging_enabled}" != "true" ]]; then echo " ${CROSS} Warning: Query logging is disabled" fi echo -e " ${INFO} Press Ctrl-C to exit" # Get logfile path - readonly LOGFILE=$(getFTLConfigValue files.log.dnsmasq) + readonly LOGFILE + LOGFILE=$(getFTLConfigValue files.log.dnsmasq) # Strip date from each line # Color blocklist/denylist/wildcard entries as red