From 4e0ad520010a5d69b37fb6f8596de3b8f15c2954 Mon Sep 17 00:00:00 2001 From: Mcat12 Date: Fri, 28 Jun 2019 20:57:05 -0700 Subject: [PATCH] Fix ShellCheck issue by refactoring a bit Signed-off-by: Mcat12 --- automated install/basic-install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 5f21d4ee..b2a1c20f 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2383,14 +2383,16 @@ FTLcheckUpdate() { if [[ ${ftlLoc} ]]; then local FTLversion FTLversion=$(/usr/bin/pihole-FTL tag) + local FTLreleaseData local FTLlatesttag - FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep 'Location' | awk -F '/' '{print $NF}' | tr -d '\r\n') - if [[ $? != 0 ]]; then + if ! FTLreleaseData=$(curl -sI https://github.com/pi-hole/FTL/releases/latest); then # There was an issue while retrieving the latest version return 3 fi + FTLlatesttag=$(grep 'Location' < "${FTLreleaseData}" | awk -F '/' '{print $NF}' | tr -d '\r\n') + if [[ "${FTLversion}" != "${FTLlatesttag}" ]]; then return 0 else