From 38ba079baaaf3d6109962c724e0e4a55dfcfd77f Mon Sep 17 00:00:00 2001 From: DL6ER Date: Tue, 7 Mar 2017 23:54:32 +0100 Subject: [PATCH] Merge pull request #1307 from pi-hole/fix/versionwithoutwebinterface Don't try to obtain version of web interface it it is not installed --- advanced/Scripts/version.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/advanced/Scripts/version.sh b/advanced/Scripts/version.sh index fd74c2de..7f96e29a 100755 --- a/advanced/Scripts/version.sh +++ b/advanced/Scripts/version.sh @@ -81,16 +81,22 @@ getRemoteVersion(){ normalOutput() { echo "::: Pi-hole version is $(getLocalVersion "${PHGITDIR}") (Latest version is $(getRemoteVersion pi-hole))" - echo "::: Web-Admin version is $(getLocalVersion "${WEBGITDIR}") (Latest version is $(getRemoteVersion AdminLTE))" + if [ -d "${WEBGITDIR}" ]; then + echo "::: Web-Admin version is $(getLocalVersion "${WEBGITDIR}") (Latest version is $(getRemoteVersion AdminLTE))" + fi } webOutput() { - case "${1}" in - "-l" | "--latest" ) echo $(getRemoteVersion AdminLTE);; - "-c" | "--current" ) echo $(getLocalVersion "${WEBGITDIR}");; - "-h" | "--hash" ) echo $(getLocalHash "${WEBGITDIR}");; - * ) echo "::: Invalid Option!"; exit 1; - esac + if [ -d "${WEBGITDIR}" ]; then + case "${1}" in + "-l" | "--latest" ) echo $(getRemoteVersion AdminLTE);; + "-c" | "--current" ) echo $(getLocalVersion "${WEBGITDIR}");; + "-h" | "--hash" ) echo $(getLocalHash "${WEBGITDIR}");; + * ) echo "::: Invalid Option!"; exit 1; + esac + else + echo "::: Web interface not installed!"; exit 1; + fi } coreOutput() {