style(HELPERSCRIPTS): reformat code

This commit is contained in:
Asif Bacchus 2021-01-15 06:11:24 -07:00
parent 9d5c7960c9
commit db4be32b54

View File

@ -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"