Source files relative to the repos root

Signed-off-by: Christian König <github@yubiuser.dev>
This commit is contained in:
Christian König 2025-04-07 14:01:47 +02:00
parent 135b0cce14
commit 5002ce8ba7
No known key found for this signature in database
13 changed files with 24 additions and 22 deletions

View File

@ -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() {

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() {

View File

@ -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

View File

@ -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")

View File

@ -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

View File

@ -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

View File

@ -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}"

View File

@ -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

3
pihole
View File

@ -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 "$@"