From b71d33c842d4b84071bf040471ab0bbb472646d7 Mon Sep 17 00:00:00 2001 From: mag37 Date: Wed, 18 Jan 2023 21:51:31 +0100 Subject: [PATCH] Update dockcheck.sh moved in arch-check to only be called if not having the binary already. --- dockcheck.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/dockcheck.sh b/dockcheck.sh index f5acb20..069e738 100644 --- a/dockcheck.sh +++ b/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