diff --git a/dockcheck_function.sh b/dockcheck_function.sh index 14ea661..2ebfaa0 100644 --- a/dockcheck_function.sh +++ b/dockcheck_function.sh @@ -9,9 +9,9 @@ dockcheck () { echo "No container name given, here's the list of currently running containers:" docker ps --format '{{.Names}}' else - RepoUrl=$(docker inspect $1 --format='{{.Config.Image}}') - LocalHash=$(docker image inspect $RepoUrl --format '{{.RepoDigests}}' | sed -e 's/.*sha256/sha256/' -e 's/\]$//') - RegHash=$(regctl image digest --list $RepoUrl) + RepoUrl=$(docker inspect "$1" --format='{{.Config.Image}}') + LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}' | sed -e 's/.*sha256/sha256/' -e 's/\]$//') + RegHash=$(regctl image digest --list "$RepoUrl") if [[ "$LocalHash" != "$RegHash" ]] ; then printf "Updates available.\n" ; else printf "Already latest.\n" ; fi fi }