mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
wrap update logic in admin_installed bool check
This commit is contained in:
parent
1428b58dde
commit
ba0abdb88d
1 changed files with 55 additions and 41 deletions
|
@ -169,7 +169,6 @@ main() {
|
||||||
web_update=false
|
web_update=false
|
||||||
echo "::: Web Interface: up to date"
|
echo "::: Web Interface: up to date"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Logic
|
# Logic
|
||||||
# If Core up to date AND web up to date:
|
# If Core up to date AND web up to date:
|
||||||
|
@ -206,6 +205,19 @@ main() {
|
||||||
echo "*** Update script has malfunctioned, fallthrough reached. Please contact support"
|
echo "*** Update script has malfunctioned, fallthrough reached. Please contact support"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
|
||||||
|
if ! ${core_update}; then
|
||||||
|
echo ":::"
|
||||||
|
echo "::: Everything is up to date!"
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo ":::"
|
||||||
|
echo "::: Pi-hole core files out of date"
|
||||||
|
getGitFiles "${PI_HOLE_FILES_DIR}" "${PI_HOLE_GIT_URL}"
|
||||||
|
/etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended || echo "Unable to complete update, contact Pi-hole" && exit 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ "${web_update}" == true ]]; then
|
if [[ "${web_update}" == true ]]; then
|
||||||
web_version_current="$(/usr/local/bin/pihole version --admin --current)"
|
web_version_current="$(/usr/local/bin/pihole version --admin --current)"
|
||||||
|
@ -221,6 +233,8 @@ main() {
|
||||||
echo "::: If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'"
|
echo "::: If you had made any changes in '/etc/.pihole/', they have been stashed using 'git stash'"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue