mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 02:42:58 +00:00
Updater implementation for FTL
This commit is contained in:
parent
dcb9797f35
commit
af2893d2ce
2 changed files with 28 additions and 2 deletions
|
@ -75,6 +75,18 @@ GitCheckUpdateAvail() {
|
|||
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() {
|
||||
local pihole_version_current
|
||||
local web_version_current
|
||||
|
@ -96,6 +108,21 @@ main() {
|
|||
echo "::: Pi-hole Core: up to date"
|
||||
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 ! is_repo "${ADMIN_INTERFACE_DIR}" ; then
|
||||
echo "::: Critical Error: Web Admin repo is missing from system!"
|
||||
|
|
|
@ -1157,8 +1157,7 @@ FTLinstall() {
|
|||
local binary="${1}"
|
||||
local latesttag
|
||||
local orig_dir
|
||||
echo ":::"
|
||||
echo -n "::: Installing FTL... "
|
||||
echo -n "::: Installing FTL... "
|
||||
|
||||
orig_dir="${PWD}"
|
||||
latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep "Location" | awk -F '/' '{print $NF}')
|
||||
|
|
Loading…
Reference in a new issue