bugfix non coreutils

This commit is contained in:
mag37
2024-06-10 21:09:04 +02:00
parent 730dba5c3d
commit 0aac94f27c

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
VERSION="v0.4.4" VERSION="v0.4.5"
### ChangeNotes: Bugfix for non amd64/arm64 arch with new timeout function. ### ChangeNotes: Bugfix for non coreutils architectures that dont have timeout
Github="https://github.com/mag37/dockcheck" Github="https://github.com/mag37/dockcheck"
RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh" RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh"
@@ -225,8 +225,10 @@ 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}}')
### Checking for errors while setting the variable: # Setting timeout-binary if existing
if RegHash=$(timeout --foreground ${Timeout} $regbin image digest --list "$RepoUrl" 2>&1) ; then if [[ $(builtin type -P "timeout") ]]; then t_out="timeout --foreground ${Timeout}"; else t_out=""; fi
# Checking for errors while setting the variable:
if RegHash=$(${t_out} $regbin image digest --list "$RepoUrl" 2>&1) ; then
if [[ "$LocalHash" = *"$RegHash"* ]] ; then if [[ "$LocalHash" = *"$RegHash"* ]] ; then
NoUpdates+=("$i") NoUpdates+=("$i")
else else