Compare commits

..

No commits in common. "901f856402ee850c7a3c8c134263a0d98130866e" and "860cc1408f4d9122718efebae61fce86763279ad" have entirely different histories.

6 changed files with 7 additions and 26 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
### update script for <ab-container> container and utility scripts
### update script for <ab-container> utility scripts
# version x.y.z
# script by Asif Bacchus
# usage of this script is subject to the license terms found at:
@ -15,13 +15,6 @@ if ! command -v wget > /dev/null 2>&1; then
exit 1
fi
# is user root or in the docker group?
if [ ! "$( id -u )" -eq 0 ]; then
if ! id -Gn | grep docker > /dev/null; then
consoleError '1' "You must either be root or in the 'docker' group to pull container updates."
fi
fi
# zero counters
updatesAvailable=0
downloadFailed=0
@ -31,7 +24,6 @@ updateSuccess=0
# reference constants
containerName=''
containerUpdatePath='docker.asifbacchus.app/...'
server='https://git.asifbacchus.app/ab-docker/scripts/raw/branch/master/'
checksumFilename='checksums.sha256'
@ -40,23 +32,10 @@ localScriptName='update.sh'
repoScriptName="${containerName}-update.sh"
updateFiles=""
### update container
printf "\n*** Updating %s container and service scripts ***\n\n" "$containerName"
printf "Updating container:\n"
if ! docker pull "$containerUpdatePath"; then
printf "There was an error updating the container. Try again later.\n\n"
exit 1
else
"Container updated!\n"
fi
printf "\n*** Updating %s container service scripts ***\n\n" "$containerName"
### update scripts
printf "Updating %s service scripts\n" "$containerName"
## download latest checksums
### download latest checksums
printf "Getting latest checksums from ab-git server... "
if ! wget --quiet --tries=3 --timeout=10 -N "${server}${checksumFilename}"; then
printf "[ERROR]\n"
@ -66,7 +45,8 @@ else
printf "[OK]\n"
fi
## check for updates to this script
### check for updates to this script
printf "Checking for updates to this script... "
repoScriptChecksum=$( grep "$repoScriptName" "$checksumFilename" | grep -o '^\S*' )
localScriptChecksum=$( sha256sum "$localScriptName" | grep -o '^\S*' )
@ -92,7 +72,8 @@ else
fi
fi
## update files
### update files
set -- dummy $updateFiles
shift
for file; do