fix(helpers): fix download bugs in update script

- do not double-check update.sh
- create target directories for wget
This commit is contained in:
Asif Bacchus 2021-07-27 21:43:53 -06:00
parent 24975088d3
commit 38af413d05

View File

@ -157,7 +157,7 @@ fi
# #
# update scripts # update scripts
if [ "$doScriptUpdate" -eq 1 ]; then if [ "$doScriptUpdate" -eq 1 ]; then
printf "%s*** Updating %s service scripts ***%s\n" "$info" "$containerName" "$norm" printf "%s*** Updating %s helper scripts ***%s\n" "$info" "$containerName" "$norm"
## download latest checksums ## download latest checksums
printf "Getting latest checksums... " printf "Getting latest checksums... "
@ -201,7 +201,12 @@ if [ "$doScriptUpdate" -eq 1 ]; then
fi fi
## update files ## update files
# ensure directories exist
if ! mkdir config sites snippets >/dev/null 2>&1; then
errMsg "Unable to make directories in which to place updated files." 40
fi
while IFS=' ' read -r field1 field2; do while IFS=' ' read -r field1 field2; do
if [ "$field2" = "update.sh" ]; then continue; fi
printf "\nChecking '%s' for updates... " "$field2" printf "\nChecking '%s' for updates... " "$field2"
updateFilename="$field2" updateFilename="$field2"
repoFileChecksum="$field1" repoFileChecksum="$field1"
@ -274,6 +279,7 @@ exit 99
# 2: docker not found or no docker permissions # 2: docker not found or no docker permissions
# 31: unable to update docker container # 31: unable to update docker container
# 4x: helper files errors # 4x: helper files errors
# 40: unable to make download directories
# 41: unable to download checksums # 41: unable to download checksums
# 42: update script: unable to download or bad checksum # 42: update script: unable to download or bad checksum
# 43: update helpers: unable to download # 43: update helpers: unable to download