mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-19 10:57:45 +00:00
rewrote regctl-download to use new functions
This commit is contained in:
24
dockcheck.sh
24
dockcheck.sh
@@ -220,27 +220,15 @@ fi
|
|||||||
# Final check if binary is correct
|
# Final check if binary is correct
|
||||||
$jqbin --version &> /dev/null || { printf "%s\n" "jq is not working - try to remove it and re-download it, exiting."; exit 1; }
|
$jqbin --version &> /dev/null || { printf "%s\n" "jq is not working - try to remove it and re-download it, exiting."; exit 1; }
|
||||||
|
|
||||||
# Check if required binary exists in PATH or directory
|
# Dependency check for regctl in PATH or directory
|
||||||
if [[ $(command -v regctl) ]]; then regbin="regctl" ;
|
if [[ $(command -v regctl) ]]; then regbin="regctl" ;
|
||||||
elif [[ -f "$ScriptWorkDir/regctl" ]]; then regbin="$ScriptWorkDir/regctl" ;
|
elif [[ -f "$ScriptWorkDir/regctl" ]]; then regbin="$ScriptWorkDir/regctl" ;
|
||||||
else
|
else
|
||||||
read -r -p "Required dependency 'regctl' missing, do you want it downloaded? y/[n] " GetDep
|
read -r -p "Required dependency 'regctl' missing, do you want it downloaded? y/[n] " GetRegctl
|
||||||
if [[ "$GetDep" =~ [yY] ]] ; then
|
if [[ "$GetRegctl" =~ [yY] ]] ; then
|
||||||
# Check architecture
|
binary_downloader "regctl" "https://github.com/regclient/regclient/releases/latest/download/regctl-linux-TEMP"
|
||||||
case "$(uname --machine)" in
|
[[ -f "$ScriptWorkDir/regctl" ]] && jqbin="$ScriptWorkDir/regctl"
|
||||||
x86_64|amd64) architecture="amd64" ;;
|
else printf "%s\n" "Dependency missing, quitting." ; exit 1 ;
|
||||||
arm64|aarch64) architecture="arm64";;
|
|
||||||
*) echo "Architecture not supported, exiting." ; exit 1;;
|
|
||||||
esac
|
|
||||||
RegUrl="https://github.com/regclient/regclient/releases/latest/download/regctl-linux-$architecture"
|
|
||||||
if [[ $(command -v curl) ]]; then curl -L $RegUrl > "$ScriptWorkDir/regctl" ; chmod +x "$ScriptWorkDir/regctl" ; regbin="$ScriptWorkDir/regctl" ;
|
|
||||||
elif [[ $(command -v wget) ]]; then wget $RegUrl -O "$ScriptWorkDir/regctl" ; chmod +x "$ScriptWorkDir/regctl" ; regbin="$ScriptWorkDir/regctl" ;
|
|
||||||
else
|
|
||||||
printf "%s\n" "curl/wget not available - get regctl manually from the repo link, quitting."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
printf "%s\n" "Dependency missing, quitting."
|
|
||||||
exit 1
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
# Final check if binary is correct
|
# Final check if binary is correct
|
||||||
|
|||||||
Reference in New Issue
Block a user