diff --git a/advanced/Scripts/update.sh b/advanced/Scripts/update.sh index 41748717..2feecd54 100644 --- a/advanced/Scripts/update.sh +++ b/advanced/Scripts/update.sh @@ -14,10 +14,10 @@ # Variables -webInterfaceGitUrl="https://github.com/pi-hole/AdminLTE.git" -webInterfaceDir="/var/www/html/admin" -piholeGitUrl="https://github.com/pi-hole/pi-hole.git" -piholeFilesDir="/etc/.pihole" +readonly WEBINTERFACEGITURL="https://github.com/pi-hole/AdminLTE.git" +readonly WEBINTERFACEDIR="/var/www/html/admin" +readonly PIHOLEGITURL="https://github.com/pi-hole/pi-hole.git" +readonly PIHOLEFILESDIR="/etc/.pihole" spinner() { local pid=${1} @@ -117,7 +117,7 @@ if [[ "${piholeVersion}" == "${piholeVersionLatest}" ]] && [[ "${webVersion}" == elif [[ "${piholeVersion} == ${piholeVersionLatest}" ]] && [[ "${webVersion}" != "${webVersionLatest}" ]]; then echo "::: Pi-hole Web Admin files out of date" - getGitFiles "${webInterfaceDir}" "${webInterfaceGitUrl}" + getGitFiles "${WEBINTERFACEDIR}" "${WEBINTERFACEGITURL}" echo ":::" webVersion=$(pihole -v -a -c) echo "::: Web Admin version is now at ${webVersion}" @@ -125,7 +125,7 @@ elif [[ "${piholeVersion} == ${piholeVersionLatest}" ]] && [[ "${webVersion}" != echo "" elif [[ "${piholeVersion}" != "${piholeVersionLatest}" ]] && [[ "${webVersion}" == "${webVersionLatest}" ]]; then echo "::: Pi-hole core files out of date" - getGitFiles "${piholeFilesDir}" "${piholeGitUrl}" + getGitFiles "${PIHOLEFILESDIR}" "${PIHOLEGITURL}" /etc/.pihole/automated\ install/basic-install.sh --reconfigure --unattended echo ":::" piholeVersion=$(pihole -v -p -c) @@ -134,7 +134,7 @@ elif [[ "${piholeVersion}" != "${piholeVersionLatest}" ]] && [[ "${webVersion}" echo "" elif [[ "${piholeVersion}" != "${piholeVersionLatest}" ]] && [[ "${webVersion}" != "${webVersionLatest}" ]]; then echo "::: Updating Everything" - getGitFiles "${piholeFilesDir}" "${piholeGitUrl}" + getGitFiles "${PIHOLEFILESDIR}" "${PIHOLEGITURL}" /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