mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-21 03:40:39 +00:00
potential busybox fix
This commit is contained in:
+11
-2
@@ -217,6 +217,17 @@ fi
|
|||||||
DocCount=$(docker ps $Stopped --filter "name=$SearchName" --format '{{.Names}}' | wc -l)
|
DocCount=$(docker ps $Stopped --filter "name=$SearchName" --format '{{.Names}}' | wc -l)
|
||||||
RegCheckQue=0
|
RegCheckQue=0
|
||||||
|
|
||||||
|
### Testing and setting timeout binary
|
||||||
|
t_out=$(type -P "timeout")
|
||||||
|
if [[ $t_out ]]; then
|
||||||
|
t_out=$(realpath $t_out 2>/dev/null || readlink -f $t_out)
|
||||||
|
if [[ $t_out =~ "busybox" ]]; then
|
||||||
|
t_out="timeout ${Timeout}"
|
||||||
|
else t_out="timeout --foreground ${Timeout}"
|
||||||
|
fi
|
||||||
|
else t_out=""
|
||||||
|
fi
|
||||||
|
|
||||||
### Check the image-hash of every running container VS the registry
|
### Check the image-hash of every running container VS the registry
|
||||||
for i in $(docker ps $Stopped --filter "name=$SearchName" --format '{{.Names}}') ; do
|
for i in $(docker ps $Stopped --filter "name=$SearchName" --format '{{.Names}}') ; do
|
||||||
((RegCheckQue+=1))
|
((RegCheckQue+=1))
|
||||||
@@ -225,8 +236,6 @@ for i in $(docker ps $Stopped --filter "name=$SearchName" --format '{{.Names}}')
|
|||||||
for e in "${Excludes[@]}" ; do [[ "$i" == "$e" ]] && continue 2 ; done
|
for e in "${Excludes[@]}" ; do [[ "$i" == "$e" ]] && continue 2 ; done
|
||||||
RepoUrl=$(docker inspect "$i" --format='{{.Config.Image}}')
|
RepoUrl=$(docker inspect "$i" --format='{{.Config.Image}}')
|
||||||
LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}')
|
LocalHash=$(docker image inspect "$RepoUrl" --format '{{.RepoDigests}}')
|
||||||
# Setting timeout-binary if existing
|
|
||||||
if [[ $(builtin type -P "timeout") ]]; then t_out="timeout --foreground ${Timeout}"; else t_out=""; fi
|
|
||||||
# Checking for errors while setting the variable:
|
# Checking for errors while setting the variable:
|
||||||
if RegHash=$(${t_out} $regbin image digest --list "$RepoUrl" 2>&1) ; then
|
if RegHash=$(${t_out} $regbin image digest --list "$RepoUrl" 2>&1) ; then
|
||||||
if [[ "$LocalHash" = *"$RegHash"* ]] ; then
|
if [[ "$LocalHash" = *"$RegHash"* ]] ; then
|
||||||
|
|||||||
Reference in New Issue
Block a user