mirror of
https://github.com/mag37/dockcheck.git
synced 2026-03-06 00:50:32 +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
|
#!/bin/bash
|
||||||
|
|
||||||
### Check arch:
|
### Check if required binary exists in PATH or directory:
|
||||||
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:
|
|
||||||
if [[ $(builtin type -P "regctl") ]]; then
|
if [[ $(builtin type -P "regctl") ]]; then
|
||||||
regbin="regctl"
|
regbin="regctl"
|
||||||
elif [[ -f "./regctl" ]]; then
|
elif [[ -f "./regctl" ]]; then
|
||||||
|
|
@ -18,6 +9,14 @@ else
|
||||||
printf "Required dependency 'regctl' missing, do you want it downloaded? y/[n]\n"
|
printf "Required dependency 'regctl' missing, do you want it downloaded? y/[n]\n"
|
||||||
read GetDep
|
read GetDep
|
||||||
if [ "$GetDep" != "${GetDep#[Yy]}" ]; then
|
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
|
curl -L https://github.com/regclient/regclient/releases/latest/download/regctl-linux-$architecture >./regctl
|
||||||
chmod 755 ./regctl
|
chmod 755 ./regctl
|
||||||
regbin="./regctl"
|
regbin="./regctl"
|
||||||
|
|
@ -27,6 +26,7 @@ else
|
||||||
fi
|
fi
|
||||||
fi
|
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 --format '{{.Names}}')
|
for i in $(docker ps --format '{{.Names}}')
|
||||||
do
|
do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue