From ca00ffa101d919b0fc493201a734646a620b0de0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20K=C3=B6nig?= Date: Thu, 2 Feb 2023 11:58:58 +0100 Subject: [PATCH] Only source versions file if the file exits MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christian König --- pihole | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pihole b/pihole index a99a37e7..1d9ad82c 100755 --- a/pihole +++ b/pihole @@ -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"