Only source versions file if the file exits

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2023-02-02 11:58:58 +01:00
parent 460f83580e
commit ca00ffa101
No known key found for this signature in database

7
pihole
View file

@ -24,7 +24,12 @@ utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
source "${utilsfile}"
versionsfile="/etc/pihole/versions"
source "${versionsfile}"
if [ -f "${versionsfile}" ]; then
# Only source versionsfile if the file exits
# fixes a warning during installation where versionsfile does not exist yet
# but gravity calls `pihole -status` and thereby sourcing the file
source "${versionsfile}"
fi
webpageFunc() {
source "${PI_HOLE_SCRIPT_DIR}/webpage.sh"