Change to use API instead of the Location Header

(some trailing whitespace removed)

Signed-off-by: Adam Warner <me@adamwarner.co.uk>
pull/3137/head
Adam Warner 4 years ago
parent e528903488
commit 1072078e26
No known key found for this signature in database
GPG Key ID: 872950F3ECF2B173

@ -2229,7 +2229,7 @@ FTLinstall() {
printf " %b %s..." "${INFO}" "${str}"
# Find the latest version tag for FTL
latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep "Location" | awk -F '/' '{print $NF}')
latesttag=$(curl --silent "https://api.github.com/repos/pi-hole/ftl/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
# Tags should always start with v, check for that.
if [[ ! "${latesttag}" == v* ]]; then
printf "%b %b %s\\n" "${OVER}" "${CROSS}" "${str}"

Loading…
Cancel
Save