From db4be32b54ebb50c53562eb47a063f8fa434e65b Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Fri, 15 Jan 2021 06:11:24 -0700 Subject: [PATCH] style(HELPERSCRIPTS): reformat code --- helpers/update.sh | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/helpers/update.sh b/helpers/update.sh index b5f2e91..4071141 100644 --- a/helpers/update.sh +++ b/helpers/update.sh @@ -102,32 +102,30 @@ doScriptUpdate=1 localScriptName="$(basename "$0")" repoScriptName='update.sh' - ### process startup parameters while [ $# -gt 0 ]; do case "$1" in - -h|-\?|--help) - # display inline help - scriptHelp - ;; - -s|--scripts|--scripts-only) - # update scripts only, skip docker container update - doDockerUpdate=0 - ;; - -c|--container|--container-only) - # update docker container only, skip script update - doScriptUpdate=0 - ;; - *) - printf "%s\nUnknown option: %s\n" "$err" "$1" - printf "%sUse '--help' for valid options%s\n\n" "$info" "$norm" - exit 1 - ;; + -h | -\? | --help) + # display inline help + scriptHelp + ;; + -s | --scripts | --scripts-only) + # update scripts only, skip docker container update + doDockerUpdate=0 + ;; + -c | --container | --container-only) + # update docker container only, skip script update + doScriptUpdate=0 + ;; + *) + printf "%s\nUnknown option: %s\n" "$err" "$1" + printf "%sUse '--help' for valid options%s\n\n" "$info" "$norm" + exit 1 + ;; esac -shift + shift done - ### update container if [ "$doDockerUpdate" -eq 1 ]; then # check if docker is installed @@ -150,7 +148,6 @@ if [ "$doDockerUpdate" -eq 1 ]; then fi fi - ### update scripts if [ "$doScriptUpdate" -eq 1 ]; then printf "%s*** Updating %s service scripts ***%s\n" "$info" "$containerName" "$norm" @@ -202,9 +199,9 @@ if [ "$doScriptUpdate" -eq 1 ]; then updateFilename="$field2" repoFileChecksum="$field1" if [ -f "$updateFilename" ]; then - localFileChecksum=$(sha256sum "$updateFilename" | grep -o '^\S*') + localFileChecksum=$(sha256sum "$updateFilename" | grep -o '^\S*') else - localFileChecksum=0 + localFileChecksum=0 fi # update file if necessary @@ -242,7 +239,6 @@ if [ "$doScriptUpdate" -eq 1 ]; then done <"$checksumFilename" fi - ### display results if [ "$doScriptUpdate" -eq 1 ]; then printf "\n%s*** Results ***%s\n" "$info" "$norm"