Skip to content

Commit ca00ffa

Browse files
committed
Only source versions file if the file exits
Signed-off-by: Christian König <[email protected]>
1 parent 460f835 commit ca00ffa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

pihole

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@ utilsfile="${PI_HOLE_SCRIPT_DIR}/utils.sh"
2424
source "${utilsfile}"
2525

2626
versionsfile="/etc/pihole/versions"
27-
source "${versionsfile}"
27+
if [ -f "${versionsfile}" ]; then
28+
# Only source versionsfile if the file exits
29+
# fixes a warning during installation where versionsfile does not exist yet
30+
# but gravity calls `pihole -status` and thereby sourcing the file
31+
source "${versionsfile}"
32+
fi
2833

2934
webpageFunc() {
3035
source "${PI_HOLE_SCRIPT_DIR}/webpage.sh"

0 commit comments

Comments
 (0)