From b4c2bf678f4715da45cd22dcf56ca68d1a877112 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Mon, 24 Feb 2020 20:02:48 +0000 Subject: [PATCH] Safeguard against colour output in grep commandadd -i to grep to make search for "Location" case-insensitive Signed-off-by: Adam Warner --- automated install/basic-install.sh | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh index 9986df3c..ee4793e7 100755 --- a/automated install/basic-install.sh +++ b/automated install/basic-install.sh @@ -2382,17 +2382,14 @@ FTLcheckUpdate() { if [[ ${ftlLoc} ]]; then local FTLversion FTLversion=$(/usr/bin/pihole-FTL tag) - local FTLreleaseData local FTLlatesttag - if ! FTLreleaseData=$(curl -sI https://github.com/pi-hole/FTL/releases/latest); then + if ! FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never -i Location | awk -F / '{print $NF}' | tr -d '[:cntrl:]'); then # There was an issue while retrieving the latest version printf " %b Failed to retrieve latest FTL release metadata" "${CROSS}" return 3 fi - FTLlatesttag=$(grep 'Location' <<< "${FTLreleaseData}" | awk -F '/' '{print $NF}' | tr -d '\r\n') - if [[ "${FTLversion}" != "${FTLlatesttag}" ]]; then return 0 else