Spellcheck improvements (no warnings in pihole and advanced/Scripts/webpage.sh remains)
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -22,16 +22,21 @@ readonly gravityDBfile="/etc/pihole/gravity.db"
|
|||||||
|
|
||||||
# Source install script for ${setupVars}, ${PI_HOLE_BIN_DIR} and valid_ip()
|
# Source install script for ${setupVars}, ${PI_HOLE_BIN_DIR} and valid_ip()
|
||||||
readonly PI_HOLE_FILES_DIR="/etc/.pihole"
|
readonly PI_HOLE_FILES_DIR="/etc/.pihole"
|
||||||
|
setupVars=""
|
||||||
|
DHCP_IPv6=false
|
||||||
# shellcheck disable=SC2034 # used in basic-install
|
# shellcheck disable=SC2034 # used in basic-install
|
||||||
PH_TEST="true"
|
PH_TEST="true"
|
||||||
source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
|
source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh"
|
||||||
|
|
||||||
# ensure_newline()
|
# ensure_newline()
|
||||||
source "utils.sh"
|
readonly utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
|
||||||
|
# shellcheck source=./utils.sh
|
||||||
|
source "${utilsfile}"
|
||||||
|
|
||||||
coltable="/opt/pihole/COL_TABLE"
|
readonly coltable="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
||||||
if [[ -f ${coltable} ]]; then
|
if [[ -f ${coltable} ]]; then
|
||||||
source ${coltable}
|
# shellcheck source=./COL_TABLE
|
||||||
|
source "${coltable}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
helpFunc() {
|
helpFunc() {
|
||||||
|
22
pihole
22
pihole
@@ -18,12 +18,16 @@ setupVars="/etc/pihole/setupVars.conf"
|
|||||||
PI_HOLE_BIN_DIR="/usr/local/bin"
|
PI_HOLE_BIN_DIR="/usr/local/bin"
|
||||||
|
|
||||||
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE"
|
||||||
|
# shellcheck source=./advanced/Scripts/COL_TABLE
|
||||||
source "${colfile}"
|
source "${colfile}"
|
||||||
|
|
||||||
# ensure_newline()
|
# ensure_newline()
|
||||||
source "utils.sh"
|
readonly utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
|
||||||
|
# shellcheck source=./advanced/Scripts/utils.sh
|
||||||
|
source "${utilsfile}"
|
||||||
|
|
||||||
webpageFunc() {
|
webpageFunc() {
|
||||||
|
# shellcheck source=./advanced/Scripts/webpage.sh
|
||||||
source "${PI_HOLE_SCRIPT_DIR}/webpage.sh"
|
source "${PI_HOLE_SCRIPT_DIR}/webpage.sh"
|
||||||
main "$@"
|
main "$@"
|
||||||
exit 0
|
exit 0
|
||||||
@@ -40,9 +44,13 @@ debugFunc() {
|
|||||||
|
|
||||||
# Pull off the `debug` leaving passed call augmentation flags in $1
|
# Pull off the `debug` leaving passed call augmentation flags in $1
|
||||||
shift
|
shift
|
||||||
|
# We do not want to be warned about implicit concatenation of array in [[ ]]
|
||||||
|
# as this is exactly what we want here
|
||||||
|
# shellcheck disable=SC2199
|
||||||
if [[ "$@" == *"-a"* ]]; then
|
if [[ "$@" == *"-a"* ]]; then
|
||||||
automated="true"
|
automated="true"
|
||||||
fi
|
fi
|
||||||
|
# shellcheck disable=SC2199
|
||||||
if [[ "$@" == *"-w"* ]]; then
|
if [[ "$@" == *"-w"* ]]; then
|
||||||
web="true"
|
web="true"
|
||||||
fi
|
fi
|
||||||
@@ -157,7 +165,7 @@ Time:
|
|||||||
echo -e " ${INFO} Blocking already disabled, nothing to do"
|
echo -e " ${INFO} Blocking already disabled, nothing to do"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
if [[ $# > 1 ]]; then
|
if [[ $# -gt 1 ]]; then
|
||||||
local error=false
|
local error=false
|
||||||
if [[ "${2}" == *"s" ]]; then
|
if [[ "${2}" == *"s" ]]; then
|
||||||
tt=${2%"s"}
|
tt=${2%"s"}
|
||||||
@@ -165,7 +173,7 @@ Time:
|
|||||||
local str="Disabling blocking for ${tt} seconds"
|
local str="Disabling blocking for ${tt} seconds"
|
||||||
echo -e " ${INFO} ${str}..."
|
echo -e " ${INFO} ${str}..."
|
||||||
local str="Blocking will be re-enabled in ${tt} seconds"
|
local str="Blocking will be re-enabled in ${tt} seconds"
|
||||||
nohup "${PI_HOLE_SCRIPT_DIR}"/pihole-reenable.sh ${tt} </dev/null &>/dev/null &
|
nohup "${PI_HOLE_SCRIPT_DIR}/pihole-reenable.sh" "${tt}" </dev/null &>/dev/null &
|
||||||
else
|
else
|
||||||
local error=true
|
local error=true
|
||||||
fi
|
fi
|
||||||
@@ -175,8 +183,8 @@ Time:
|
|||||||
local str="Disabling blocking for ${tt} minutes"
|
local str="Disabling blocking for ${tt} minutes"
|
||||||
echo -e " ${INFO} ${str}..."
|
echo -e " ${INFO} ${str}..."
|
||||||
local str="Blocking will be re-enabled in ${tt} minutes"
|
local str="Blocking will be re-enabled in ${tt} minutes"
|
||||||
tt=$((${tt}*60))
|
tt=$((tt*60))
|
||||||
nohup "${PI_HOLE_SCRIPT_DIR}"/pihole-reenable.sh ${tt} </dev/null &>/dev/null &
|
nohup "${PI_HOLE_SCRIPT_DIR}/pihole-reenable.sh" "${tt}" </dev/null &>/dev/null &
|
||||||
else
|
else
|
||||||
local error=true
|
local error=true
|
||||||
fi
|
fi
|
||||||
@@ -325,7 +333,8 @@ statusFunc() {
|
|||||||
|
|
||||||
tailFunc() {
|
tailFunc() {
|
||||||
# Warn user if Pi-hole's logging is disabled
|
# Warn user if Pi-hole's logging is disabled
|
||||||
local logging_enabled=$(grep -c "^log-queries" /etc/dnsmasq.d/01-pihole.conf)
|
local logging_enabled
|
||||||
|
logging_enabled=$(grep -c "^log-queries" /etc/dnsmasq.d/01-pihole.conf)
|
||||||
if [[ "${logging_enabled}" == "0" ]]; then
|
if [[ "${logging_enabled}" == "0" ]]; then
|
||||||
# No "log-queries" lines are found.
|
# No "log-queries" lines are found.
|
||||||
# Commented out lines (such as "#log-queries") are ignored
|
# Commented out lines (such as "#log-queries") are ignored
|
||||||
@@ -366,6 +375,7 @@ Branches:
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# shellcheck source=./advanced/Scripts/piholeCheckout.sh
|
||||||
source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh
|
source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh
|
||||||
shift
|
shift
|
||||||
checkout "$@"
|
checkout "$@"
|
||||||
|
Reference in New Issue
Block a user