1
0
mirror of https://github.com/pi-hole/pi-hole synced 2025-07-02 05:12:32 +00:00

Change FTLcheckUpdate to use api.github.com and jq to retrieve tag_name

Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
This commit is contained in:
RD WebDesign 2025-05-12 15:53:12 -03:00
parent 1bdbc26a07
commit e01d49b3ee
No known key found for this signature in database
GPG Key ID: AE3C7FC910687F33

View File

@ -1972,12 +1972,14 @@ FTLcheckUpdate() {
# same as the remote one
local FTLversion
FTLversion=$(/usr/bin/pihole-FTL tag)
local FTLlatesttag
# Get the latest version from the GitHub API
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
local FTLlatesttag
FTLlatesttag=$(curl -s https://api.github.com/repos/pi-hole/FTL/releases/latest | jq -sRr 'fromjson? | .tag_name | values')
if [ -z "${FTLlatesttag}" ]; then
# There was an issue while retrieving the latest version
printf " %b Failed to retrieve latest FTL release metadata" "${CROSS}"
printf " %b Failed to retrieve latest FTL release metadata\\n" "${CROSS}"
return 3
fi
@ -1995,6 +1997,7 @@ FTLcheckUpdate() {
# Continue further down...
fi
else
# FTL not installed, then download
return 0
fi
fi