mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-15 07:48:14 +01:00
Update dockcheck.sh
moved in arch-check to only be called if not having the binary already.
This commit is contained in:
parent
07fe6ab9eb
commit
b71d33c842
1 changed files with 10 additions and 10 deletions
20
dockcheck.sh
20
dockcheck.sh
|
|
@ -1,15 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
### Check arch:
|
||||
case "$(uname --machine)" in
|
||||
x86_64|amd64)
|
||||
architecture="amd64";;
|
||||
arm64|aarch64)
|
||||
architecture="arm64";;
|
||||
*) echo "Architecture not supported, exiting." ; exit ;;
|
||||
esac
|
||||
|
||||
### Check if required application exists in PATH or directory:
|
||||
### Check if required binary exists in PATH or directory:
|
||||
if [[ $(builtin type -P "regctl") ]]; then
|
||||
regbin="regctl"
|
||||
elif [[ -f "./regctl" ]]; then
|
||||
|
|
@ -18,6 +9,14 @@ else
|
|||
printf "Required dependency 'regctl' missing, do you want it downloaded? y/[n]\n"
|
||||
read GetDep
|
||||
if [ "$GetDep" != "${GetDep#[Yy]}" ]; then
|
||||
### Check arch:
|
||||
case "$(uname --machine)" in
|
||||
x86_64|amd64)
|
||||
architecture="amd64";;
|
||||
arm64|aarch64)
|
||||
architecture="arm64";;
|
||||
*) echo "Architecture not supported, exiting." ; exit ;;
|
||||
esac
|
||||
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-$architecture >./regctl
|
||||
chmod 755 ./regctl
|
||||
regbin="./regctl"
|
||||
|
|
@ -27,6 +26,7 @@ else
|
|||
fi
|
||||
fi
|
||||
|
||||
|
||||
### Check the image-hash of every running container VS the registry
|
||||
for i in $(docker ps --format '{{.Names}}')
|
||||
do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue