mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-12-25 14:20:18 +00:00
Protect against unexepcted return values (GitHub not responding as we'd expect.) And make sure bash doesn't maul the variables and cause firing of unattended reinstall of application when values returned aren't as expected.
This commit is contained in:
parent
1e7e5230cc
commit
0c9520d7e3
1 changed files with 7 additions and 4 deletions
|
@ -108,12 +108,12 @@ echo ":::"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if [[ ${piholeVersion} == ${piholeVersionLatest} ]] && [[ "${webVersion}" == "${webVersionLatest}" ]]; then
|
if [[ "${piholeVersion}" == "${piholeVersionLatest}" ]] && [[ "${webVersion}" == "${webVersionLatest}" ]]; then
|
||||||
echo "::: Everything is up to date!"
|
echo "::: Everything is up to date!"
|
||||||
echo ""
|
echo ""
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
elif [[ ${piholeVersion} == ${piholeVersionLatest} ]] && [[ ${webVersion} != ${webVersionLatest} ]]; then
|
elif [[ "${piholeVersion} == ${piholeVersionLatest}" ]] && [[ "${webVersion}" != "${webVersionLatest}" ]]; then
|
||||||
echo "::: Pi-hole Web Admin files out of date"
|
echo "::: Pi-hole Web Admin files out of date"
|
||||||
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl}
|
getGitFiles ${webInterfaceDir} ${webInterfaceGitUrl}
|
||||||
echo ":::"
|
echo ":::"
|
||||||
|
@ -121,7 +121,7 @@ elif [[ ${piholeVersion} == ${piholeVersionLatest} ]] && [[ ${webVersion} != ${w
|
||||||
echo "::: Web Admin version is now at ${webVersion}"
|
echo "::: Web Admin version is now at ${webVersion}"
|
||||||
echo "::: If you had made any changes in '/var/www/html/admin', they have been stashed using 'git stash'"
|
echo "::: If you had made any changes in '/var/www/html/admin', they have been stashed using 'git stash'"
|
||||||
echo ""
|
echo ""
|
||||||
elif [[ ${piholeVersion} != ${piholeVersionLatest} ]] && [[ ${webVersion} == ${webVersionLatest} ]]; then
|
elif [[ "${piholeVersion}" != "${piholeVersionLatest}" ]] && [[ "${webVersion}" == "${webVersionLatest}" ]]; then
|
||||||
echo "::: Pi-hole core files out of date"
|
echo "::: Pi-hole core files out of date"
|
||||||
getGitFiles ${piholeFilesDir} ${piholeGitUrl}
|
getGitFiles ${piholeFilesDir} ${piholeGitUrl}
|
||||||
/etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended
|
/etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended
|
||||||
|
@ -130,11 +130,14 @@ elif [[ ${piholeVersion} != ${piholeVersionLatest} ]] && [[ ${webVersion} == ${w
|
||||||
echo "::: Pi-hole version is now at ${piholeVersion}"
|
echo "::: Pi-hole version is now at ${piholeVersion}"
|
||||||
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'"
|
||||||
echo ""
|
echo ""
|
||||||
elif [[ ${piholeVersion} != ${piholeVersionLatest} ]] && [[ ${webVersion} != ${webVersionLatest} ]]; then
|
elif [[ "${piholeVersion}" != "${piholeVersionLatest}" ]] && [[ "${webVersion}" != "${webVersionLatest}" ]]; then
|
||||||
echo "::: Updating Everything"
|
echo "::: Updating Everything"
|
||||||
getGitFiles ${piholeFilesDir} ${piholeGitUrl}
|
getGitFiles ${piholeFilesDir} ${piholeGitUrl}
|
||||||
/etc/.pihole/automated\ install/basic-install.sh --unattended
|
/etc/.pihole/automated\ install/basic-install.sh --unattended
|
||||||
|
|
||||||
|
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
||||||
webVersion=$(pihole -v -a -c)
|
webVersion=$(pihole -v -a -c)
|
||||||
|
# Checks Pi-hole version > admin only > current local git repo version : returns string in format vX.X.X
|
||||||
piholeVersion=$(pihole -v -p -c)
|
piholeVersion=$(pihole -v -p -c)
|
||||||
echo ":::"
|
echo ":::"
|
||||||
echo "::: Pi-hole version is now at ${piholeVersion}"
|
echo "::: Pi-hole version is now at ${piholeVersion}"
|
||||||
|
|
Loading…
Reference in a new issue