Fix pull logic and properly hide output

This commit is contained in:
William Wernert
2021-08-11 16:33:45 -04:00
parent 95bd7f9861
commit 64dfc6e191
2 changed files with 37 additions and 29 deletions

View File

@@ -32,6 +32,12 @@ usage() {
exit 1
}
for arg; do
shift
[[ "$arg" = "--quiet" || "$arg" = "-q" ]] && quiet=true && continue
set -- "$@" "$arg"
done
if [[ $# -eq 0 || $# -gt 1 ]] || [[ $1 == '-h' || $1 == '--help' ]]; then
usage
fi
@@ -41,8 +47,12 @@ set_version
for image in "${TRUSTED_CONTAINERS[@]}"; do
if ! docker images | grep "$image" | grep ":5000" | grep -q "$VERSION"; then
update_docker_containers "$image" "" "" ""
if [[ $quiet == true ]]; then
update_docker_containers "$image" "" "" "/dev/null"
else
update_docker_containers "$image" "" "" ""
fi
else
echo "$image:$VERSION image exists." 1>&2
echo "$image:$VERSION image exists."
fi
done