wrap update logic in admin_installed bool check

This commit is contained in:
Promofaux 2017-02-05 19:12:09 +00:00
parent 1428b58dde
commit ba0abdb88d

View file

@ -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