mirror of
https://github.com/pi-hole/pi-hole
synced 2025-07-23 07:28:26 +00:00
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 <me@adamwarner.co.uk>
This commit is contained in:
parent
f5dc337d1b
commit
3a9b9c027e
16
pihole
16
pihole
@ -9,6 +9,8 @@
|
|||||||
# This file is copyright under the latest version of the EUPL.
|
# This file is copyright under the latest version of the EUPL.
|
||||||
# Please see LICENSE file for your rights under this license.
|
# Please see LICENSE file for your rights under this license.
|
||||||
|
|
||||||
|
# shellcheck disable=SC1090
|
||||||
|
|
||||||
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
readonly PI_HOLE_SCRIPT_DIR="/opt/pihole"
|
||||||
|
|
||||||
# PI_HOLE_BIN_DIR is not readonly here because in some functions (checkout),
|
# 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} }")
|
data=$(PostFTLData "dns/blocking" "{ \"blocking\": ${1}, \"timer\": ${tt} }")
|
||||||
|
|
||||||
# Check the response
|
# Check the response
|
||||||
local extra=" forever"
|
local extra timer
|
||||||
local timer="$(echo "${data}"| jq --raw-output '.timer' )"
|
extra=" forever"
|
||||||
|
timer="$(echo "${data}"| jq --raw-output '.timer' )"
|
||||||
if [[ "${timer}" != "null" ]]; then
|
if [[ "${timer}" != "null" ]]; then
|
||||||
extra=" for ${timer}s"
|
extra=" for ${timer}s"
|
||||||
fi
|
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
|
# Logout from the API
|
||||||
LogoutAPI
|
LogoutAPI
|
||||||
@ -375,14 +379,16 @@ statusFunc() {
|
|||||||
|
|
||||||
tailFunc() {
|
tailFunc() {
|
||||||
# Warn user if Pi-hole's logging is disabled
|
# 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
|
if [[ "${logging_enabled}" != "true" ]]; then
|
||||||
echo " ${CROSS} Warning: Query logging is disabled"
|
echo " ${CROSS} Warning: Query logging is disabled"
|
||||||
fi
|
fi
|
||||||
echo -e " ${INFO} Press Ctrl-C to exit"
|
echo -e " ${INFO} Press Ctrl-C to exit"
|
||||||
|
|
||||||
# Get logfile path
|
# Get logfile path
|
||||||
readonly LOGFILE=$(getFTLConfigValue files.log.dnsmasq)
|
readonly LOGFILE
|
||||||
|
LOGFILE=$(getFTLConfigValue files.log.dnsmasq)
|
||||||
|
|
||||||
# Strip date from each line
|
# Strip date from each line
|
||||||
# Color blocklist/denylist/wildcard entries as red
|
# Color blocklist/denylist/wildcard entries as red
|
||||||
|
Loading…
Reference in New Issue
Block a user