mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 04:30:55 +00:00
Updater implementation for FTL
This commit is contained in:
parent
dcb9797f35
commit
af2893d2ce
@ -75,6 +75,18 @@ GitCheckUpdateAvail() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FTLcheckUpdate() {
|
||||||
|
|
||||||
|
local FTLversion=$(/usr/bin/pihole-FTL tag)
|
||||||
|
local FTLlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep 'Location' | awk -F '/' '{print $NF}' | tr -d '\r\n')
|
||||||
|
|
||||||
|
if [[ "${FTLversion}" != "${FTLlatesttag}" ]]; then
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local pihole_version_current
|
local pihole_version_current
|
||||||
local web_version_current
|
local web_version_current
|
||||||
@ -96,6 +108,21 @@ main() {
|
|||||||
echo "::: Pi-hole Core: up to date"
|
echo "::: Pi-hole Core: up to date"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if FTLcheckUpdate ; then
|
||||||
|
FTL_update=true
|
||||||
|
echo "::: FTL: update available"
|
||||||
|
else
|
||||||
|
FTL_update=false
|
||||||
|
echo "::: FTL: up to date"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ${FTL_update}; then
|
||||||
|
echo ":::"
|
||||||
|
echo "::: FTL out of date"
|
||||||
|
FTLdetect
|
||||||
|
echo ":::"
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ ${INSTALL_WEB} == true ]]; then
|
if [[ ${INSTALL_WEB} == true ]]; then
|
||||||
if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
|
if ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
|
||||||
echo "::: Critical Error: Web Admin repo is missing from system!"
|
echo "::: Critical Error: Web Admin repo is missing from system!"
|
||||||
|
@ -1157,8 +1157,7 @@ FTLinstall() {
|
|||||||
local binary="${1}"
|
local binary="${1}"
|
||||||
local latesttag
|
local latesttag
|
||||||
local orig_dir
|
local orig_dir
|
||||||
echo ":::"
|
echo -n "::: Installing FTL... "
|
||||||
echo -n "::: Installing FTL... "
|
|
||||||
|
|
||||||
orig_dir="${PWD}"
|
orig_dir="${PWD}"
|
||||||
latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep "Location" | awk -F '/' '{print $NF}')
|
latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep "Location" | awk -F '/' '{print $NF}')
|
||||||
|
Loading…
Reference in New Issue
Block a user