From e8079620f5c8e5670031d8f2a6098c21a095a8ff Mon Sep 17 00:00:00 2001 From: Subhaditya Nath Date: Sun, 15 Aug 2021 17:43:20 +0530 Subject: [PATCH] Fix https://github.com/pi-hole/pi-hole/issues/4279 Signed-off-by: Subhaditya Nath --- advanced/Scripts/version.sh | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/advanced/Scripts/version.sh b/advanced/Scripts/version.sh index 86ac45bc..978dd3fe 100755 --- a/advanced/Scripts/version.sh +++ b/advanced/Scripts/version.sh @@ -91,11 +91,19 @@ getRemoteVersion(){ #If the above file exists, then we can read from that. Prevents overuse of GitHub API if [[ -f "$cachedVersions" ]]; then IFS=' ' read -r -a arrCache < "$cachedVersions" - case $daemon in - "pi-hole" ) echo "${arrCache[0]}";; - "AdminLTE" ) echo "${arrCache[1]}";; - "FTL" ) echo "${arrCache[2]}";; - esac + + if [[ "${INSTALL_WEB_INTERFACE}" == true ]]; then + case $daemon in + "pi-hole" ) echo "${arrCache[0]}";; + "AdminLTE" ) echo "${arrCache[1]}";; + "FTL" ) echo "${arrCache[2]}";; + esac + else + case $daemon in + "pi-hole" ) echo "${arrCache[0]}";; + "FTL" ) echo "${arrCache[1]}";; + esac + fi return 0 fi @@ -140,6 +148,11 @@ getLocalBranch(){ } versionOutput() { + [[ "$1" == "AdminLTE" ]] && [[ "${INSTALL_WEB_INTERFACE}" != true ]] && { + echo " WebAdmin not installed" + return 1 + } + [[ "$1" == "pi-hole" ]] && GITDIR=$COREGITDIR [[ "$1" == "AdminLTE" ]] && GITDIR=$WEBGITDIR [[ "$1" == "FTL" ]] && GITDIR="FTL"