style(HELPERSCRIPTS): reformat code
This commit is contained in:
parent
9d5c7960c9
commit
db4be32b54
@ -102,32 +102,30 @@ doScriptUpdate=1
|
|||||||
localScriptName="$(basename "$0")"
|
localScriptName="$(basename "$0")"
|
||||||
repoScriptName='update.sh'
|
repoScriptName='update.sh'
|
||||||
|
|
||||||
|
|
||||||
### process startup parameters
|
### process startup parameters
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h|-\?|--help)
|
-h | -\? | --help)
|
||||||
# display inline help
|
# display inline help
|
||||||
scriptHelp
|
scriptHelp
|
||||||
;;
|
;;
|
||||||
-s|--scripts|--scripts-only)
|
-s | --scripts | --scripts-only)
|
||||||
# update scripts only, skip docker container update
|
# update scripts only, skip docker container update
|
||||||
doDockerUpdate=0
|
doDockerUpdate=0
|
||||||
;;
|
;;
|
||||||
-c|--container|--container-only)
|
-c | --container | --container-only)
|
||||||
# update docker container only, skip script update
|
# update docker container only, skip script update
|
||||||
doScriptUpdate=0
|
doScriptUpdate=0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printf "%s\nUnknown option: %s\n" "$err" "$1"
|
printf "%s\nUnknown option: %s\n" "$err" "$1"
|
||||||
printf "%sUse '--help' for valid options%s\n\n" "$info" "$norm"
|
printf "%sUse '--help' for valid options%s\n\n" "$info" "$norm"
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
|
||||||
### update container
|
### update container
|
||||||
if [ "$doDockerUpdate" -eq 1 ]; then
|
if [ "$doDockerUpdate" -eq 1 ]; then
|
||||||
# check if docker is installed
|
# check if docker is installed
|
||||||
@ -150,7 +148,6 @@ if [ "$doDockerUpdate" -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
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 service scripts ***%s\n" "$info" "$containerName" "$norm"
|
||||||
@ -202,9 +199,9 @@ if [ "$doScriptUpdate" -eq 1 ]; then
|
|||||||
updateFilename="$field2"
|
updateFilename="$field2"
|
||||||
repoFileChecksum="$field1"
|
repoFileChecksum="$field1"
|
||||||
if [ -f "$updateFilename" ]; then
|
if [ -f "$updateFilename" ]; then
|
||||||
localFileChecksum=$(sha256sum "$updateFilename" | grep -o '^\S*')
|
localFileChecksum=$(sha256sum "$updateFilename" | grep -o '^\S*')
|
||||||
else
|
else
|
||||||
localFileChecksum=0
|
localFileChecksum=0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# update file if necessary
|
# update file if necessary
|
||||||
@ -242,7 +239,6 @@ if [ "$doScriptUpdate" -eq 1 ]; then
|
|||||||
done <"$checksumFilename"
|
done <"$checksumFilename"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
### display results
|
### display results
|
||||||
if [ "$doScriptUpdate" -eq 1 ]; then
|
if [ "$doScriptUpdate" -eq 1 ]; then
|
||||||
printf "\n%s*** Results ***%s\n" "$info" "$norm"
|
printf "\n%s*** Results ***%s\n" "$info" "$norm"
|
||||||
|
Loading…
Reference in New Issue
Block a user