mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Fix ShellCheck issue by refactoring a bit
Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
parent
c9829dd3e4
commit
4e0ad52001
@ -2383,14 +2383,16 @@ FTLcheckUpdate() {
|
|||||||
if [[ ${ftlLoc} ]]; then
|
if [[ ${ftlLoc} ]]; then
|
||||||
local FTLversion
|
local FTLversion
|
||||||
FTLversion=$(/usr/bin/pihole-FTL tag)
|
FTLversion=$(/usr/bin/pihole-FTL tag)
|
||||||
|
local FTLreleaseData
|
||||||
local FTLlatesttag
|
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
|
# There was an issue while retrieving the latest version
|
||||||
return 3
|
return 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
FTLlatesttag=$(grep 'Location' < "${FTLreleaseData}" | awk -F '/' '{print $NF}' | tr -d '\r\n')
|
||||||
|
|
||||||
if [[ "${FTLversion}" != "${FTLlatesttag}" ]]; then
|
if [[ "${FTLversion}" != "${FTLlatesttag}" ]]; then
|
||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user