From 5002ce8ba76b0e5b9dc04412c63e14b3e429113e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Mon, 7 Apr 2025 14:01:47 +0200 Subject: [PATCH] Source files relative to the repos root MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- advanced/Scripts/list.sh | 6 +++--- advanced/Scripts/piholeARPTable.sh | 4 ++-- advanced/Scripts/piholeCheckout.sh | 2 +- advanced/Scripts/piholeDebug.sh | 2 +- advanced/Scripts/piholeLogFlush.sh | 4 ++-- advanced/Scripts/query.sh | 3 ++- advanced/Scripts/update.sh | 6 +++--- advanced/Scripts/updatecheck.sh | 2 +- advanced/Templates/pihole-FTL-poststop.sh | 2 +- advanced/Templates/pihole-FTL-prestart.sh | 2 +- automated install/basic-install.sh | 4 ++-- automated install/uninstall.sh | 6 +++--- pihole | 3 ++- 13 files changed, 24 insertions(+), 22 deletions(-) diff --git a/advanced/Scripts/list.sh b/advanced/Scripts/list.sh index c07b0f2d..fa356f16 100755 --- a/advanced/Scripts/list.sh +++ b/advanced/Scripts/list.sh @@ -11,11 +11,11 @@ readonly PI_HOLE_SCRIPT_DIR="/opt/pihole" readonly utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" -# shellcheck source="./utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" source "${utilsfile}" readonly apifile="${PI_HOLE_SCRIPT_DIR}/api.sh" -# shellcheck source="./api.sh" +# shellcheck source="./advanced/Scripts/api.sh" source "${apifile}" # Determine database location @@ -40,7 +40,7 @@ typeId="" comment="" colfile="/opt/pihole/COL_TABLE" -# shellcheck source="./COL_TABLE" +# shellcheck source="./advanced/Scripts/COL_TABLE" source ${colfile} helpFunc() { diff --git a/advanced/Scripts/piholeARPTable.sh b/advanced/Scripts/piholeARPTable.sh index 8257eb3e..c62acdbc 100755 --- a/advanced/Scripts/piholeARPTable.sh +++ b/advanced/Scripts/piholeARPTable.sh @@ -11,13 +11,13 @@ coltable="/opt/pihole/COL_TABLE" if [[ -f ${coltable} ]]; then -# shellcheck source="./COL_TABLE" +# shellcheck source="./advanced/Scripts/COL_TABLE" source ${coltable} fi readonly PI_HOLE_SCRIPT_DIR="/opt/pihole" utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" -# shellcheck source="./utils.sh" +# shellcheck source=./advanced/Scripts/utils.sh source "${utilsfile}" # Determine database location diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 21e9df9f..beaac5f1 100755 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -10,7 +10,7 @@ readonly PI_HOLE_FILES_DIR="/etc/.pihole" SKIP_INSTALL="true" -# shellcheck source="../../automated install/basic-install.sh" +# shellcheck source="./automated install/basic-install.sh" source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" # webInterfaceGitUrl set in basic-install.sh diff --git a/advanced/Scripts/piholeDebug.sh b/advanced/Scripts/piholeDebug.sh index caff6c5e..70c0ffe2 100755 --- a/advanced/Scripts/piholeDebug.sh +++ b/advanced/Scripts/piholeDebug.sh @@ -26,7 +26,7 @@ PIHOLE_COLTABLE_FILE="${PIHOLE_SCRIPTS_DIRECTORY}/COL_TABLE" # These provide the colors we need for making the log more readable if [[ -f ${PIHOLE_COLTABLE_FILE} ]]; then -# shellcheck source=./COL_TABLE +# shellcheck source=./advanced/Scripts/COL_TABLE source ${PIHOLE_COLTABLE_FILE} else COL_NC='\e[0m' # No Color diff --git a/advanced/Scripts/piholeLogFlush.sh b/advanced/Scripts/piholeLogFlush.sh index ab88fb73..84610fda 100755 --- a/advanced/Scripts/piholeLogFlush.sh +++ b/advanced/Scripts/piholeLogFlush.sh @@ -9,12 +9,12 @@ # Please see LICENSE file for your rights under this license. colfile="/opt/pihole/COL_TABLE" -# shellcheck source="./COL_TABLE" +# shellcheck source="./advanced/Scripts/COL_TABLE" source ${colfile} readonly PI_HOLE_SCRIPT_DIR="/opt/pihole" utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" -# shellcheck source="./utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" source "${utilsfile}" # In case we're running at the same time as a system logrotate, use a diff --git a/advanced/Scripts/query.sh b/advanced/Scripts/query.sh index aeebba3a..18c018dc 100755 --- a/advanced/Scripts/query.sh +++ b/advanced/Scripts/query.sh @@ -17,10 +17,11 @@ domain="" # Source color table colfile="/opt/pihole/COL_TABLE" -# shellcheck source="./COL_TABLE" +# shellcheck source="./advanced/Scripts/COL_TABLE" . "${colfile}" # Source api functions +# shellcheck source="./advanced/Scripts/api.sh" . "${PI_HOLE_INSTALL_DIR}/api.sh" Help() { diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index bcd1889a..08a50be1 100755 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -20,11 +20,11 @@ SKIP_INSTALL=true # when --check-only is passed to this script, it will not perform the actual update CHECK_ONLY=false -# shellcheck source="../../automated install/basic-install.sh" +# shellcheck source="./automated install/basic-install.sh" source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" -# shellcheck source=./COL_TABLE +# shellcheck source=./advanced/Scripts/COL_TABLE source "/opt/pihole/COL_TABLE" -# shellcheck source="./utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" source "${PI_HOLE_INSTALL_DIR}/utils.sh" # is_repo() sourced from basic-install.sh diff --git a/advanced/Scripts/updatecheck.sh b/advanced/Scripts/updatecheck.sh index 62bcbcf3..44f21419 100755 --- a/advanced/Scripts/updatecheck.sh +++ b/advanced/Scripts/updatecheck.sh @@ -39,7 +39,7 @@ function get_remote_hash() { } # Source the utils file for addOrEditKeyValPair() -# shellcheck source="./utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" . /opt/pihole/utils.sh ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") diff --git a/advanced/Templates/pihole-FTL-poststop.sh b/advanced/Templates/pihole-FTL-poststop.sh index e7db109d..504e2382 100755 --- a/advanced/Templates/pihole-FTL-poststop.sh +++ b/advanced/Templates/pihole-FTL-poststop.sh @@ -3,7 +3,7 @@ # Source utils.sh for getFTLConfigValue() PI_HOLE_SCRIPT_DIR='/opt/pihole' utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" -# shellcheck source="../Scripts/utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" . "${utilsfile}" # Get file paths diff --git a/advanced/Templates/pihole-FTL-prestart.sh b/advanced/Templates/pihole-FTL-prestart.sh index 056cb21c..579309d3 100755 --- a/advanced/Templates/pihole-FTL-prestart.sh +++ b/advanced/Templates/pihole-FTL-prestart.sh @@ -3,7 +3,7 @@ # Source utils.sh for getFTLConfigValue() PI_HOLE_SCRIPT_DIR='/opt/pihole' utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" -# shellcheck source="../Scripts/utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" . "${utilsfile}" # Get file paths diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 983d75d7..9d364ffa 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -153,7 +153,7 @@ done # If the color table file exists, if [[ -f "${coltable}" ]]; then # source it - # shellcheck source="../advanced/Scripts/COL_TABLE" + # shellcheck source="./advanced/Scripts/COL_TABLE" source "${coltable}" # Otherwise, else @@ -2399,7 +2399,7 @@ main() { # /opt/pihole/utils.sh should be installed by installScripts now, so we can use it if [ -f "${PI_HOLE_INSTALL_DIR}/utils.sh" ]; then - # shellcheck source="../advanced/Scripts/utils.sh" + # shellcheck source="./advanced/Scripts/utils.sh" source "${PI_HOLE_INSTALL_DIR}/utils.sh" else printf " %b Failure: /opt/pihole/utils.sh does not exist .\\n" "${CROSS}" diff --git a/automated install/uninstall.sh b/automated install/uninstall.sh index 1d365a37..a158e595 100755 --- a/automated install/uninstall.sh +++ b/automated install/uninstall.sh @@ -8,9 +8,9 @@ # This file is copyright under the latest version of the EUPL. # Please see LICENSE file for your rights under this license. -# shellcheck source="../advanced/Scripts/COL_TABLE" +# shellcheck source="./advanced/Scripts/COL_TABLE" source "/opt/pihole/COL_TABLE" -# shellcheck source="../advanced/Scripts/utils.sh" +# shellcheck source="./advanced/Scripts/utils.sh" source "/opt/pihole/utils.sh" ADMIN_INTERFACE_DIR=$(getFTLConfigValue "webserver.paths.webroot")$(getFTLConfigValue "webserver.paths.webhome") @@ -43,7 +43,7 @@ fi readonly PI_HOLE_FILES_DIR="/etc/.pihole" SKIP_INSTALL="true" -# shellcheck source="./basic-install.sh" +# shellcheck source="./automated install/basic-install.sh" source "${PI_HOLE_FILES_DIR}/automated install/basic-install.sh" # package_manager_detect() sourced from basic-install.sh diff --git a/pihole b/pihole index 7b645030..2c3a433b 100755 --- a/pihole +++ b/pihole @@ -17,7 +17,7 @@ readonly PI_HOLE_SCRIPT_DIR="/opt/pihole" PI_HOLE_BIN_DIR="/usr/local/bin" readonly colfile="${PI_HOLE_SCRIPT_DIR}/COL_TABLE" -# shellcheck source=./advanced/Scripts/COL_TABLE.sh +# shellcheck source=./advanced/Scripts/COL_TABLE source "${colfile}" readonly utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh" @@ -431,6 +431,7 @@ piholeCheckoutFunc() { exit 0 fi + #shellcheck source=./advanced/Scripts/piholeCheckout.sh source "${PI_HOLE_SCRIPT_DIR}"/piholeCheckout.sh shift checkout "$@"