mirror of
https://github.com/mag37/dockcheck.git
synced 2026-02-14 23:38:15 +01:00
cleaned old jq check + fixed some naming
This commit is contained in:
parent
bbe26a0ac2
commit
8309b80dc2
1 changed files with 7 additions and 13 deletions
20
dockcheck.sh
20
dockcheck.sh
|
|
@ -229,7 +229,7 @@ else
|
|||
read -r -p "Required dependency 'regctl' missing, do you want it downloaded? y/[n] " GetRegctl
|
||||
if [[ "$GetRegctl" =~ [yY] ]] ; then
|
||||
binary_downloader "regctl" "https://github.com/regclient/regclient/releases/latest/download/regctl-linux-TEMP"
|
||||
[[ -f "$ScriptWorkDir/regctl" ]] && jqbin="$ScriptWorkDir/regctl"
|
||||
[[ -f "$ScriptWorkDir/regctl" ]] && regbin="$ScriptWorkDir/regctl"
|
||||
else printf "%s\n" "Dependency missing, quitting." ; exit 1 ;
|
||||
fi
|
||||
fi
|
||||
|
|
@ -247,12 +247,6 @@ else
|
|||
exit 1
|
||||
fi
|
||||
|
||||
# Check for jq binary
|
||||
if [[ ! $(command -v jq) ]] ; then
|
||||
printf "%s\n" "No jq binary, please install jq and try again, exiting."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Numbered List function
|
||||
options() {
|
||||
num=1
|
||||
|
|
@ -352,17 +346,17 @@ if [ -n "$GotUpdates" ] ; then
|
|||
# Extract labels and metadata
|
||||
ContLabels=$(docker inspect "$i" --format '{{json .Config.Labels}}')
|
||||
ContImage=$(docker inspect "$i" --format='{{.Config.Image}}')
|
||||
ContPath=$(jq -r '."com.docker.compose.project.working_dir"' <<< "$ContLabels")
|
||||
ContPath=$(jqbin -r '."com.docker.compose.project.working_dir"' <<< "$ContLabels")
|
||||
[ "$ContPath" == "null" ] && ContPath=""
|
||||
ContConfigFile=$(jq -r '."com.docker.compose.project.config_files"' <<< "$ContLabels")
|
||||
ContConfigFile=$(jqbin -r '."com.docker.compose.project.config_files"' <<< "$ContLabels")
|
||||
[ "$ContConfigFile" == "null" ] && ContConfigFile=""
|
||||
ContName=$(jq -r '."com.docker.compose.service"' <<< "$ContLabels")
|
||||
ContName=$(jqbin -r '."com.docker.compose.service"' <<< "$ContLabels")
|
||||
[ "$ContName" == "null" ] && ContName=""
|
||||
ContEnv=$(jq -r '."com.docker.compose.project.environment_file"' <<< "$ContLabels")
|
||||
ContEnv=$(jqbin -r '."com.docker.compose.project.environment_file"' <<< "$ContLabels")
|
||||
[ "$ContEnv" == "null" ] && ContEnv=""
|
||||
ContUpdateLabel=$(jq -r '."mag37.dockcheck.update"' <<< "$ContLabels")
|
||||
ContUpdateLabel=$(jqbin -r '."mag37.dockcheck.update"' <<< "$ContLabels")
|
||||
[ "$ContUpdateLabel" == "null" ] && ContUpdateLabel=""
|
||||
ContRestartStack=$(jq -r '."mag37.dockcheck.restart-stack"' <<< "$ContLabels")
|
||||
ContRestartStack=$(jqbin -r '."mag37.dockcheck.restart-stack"' <<< "$ContLabels")
|
||||
[ "$ContRestartStack" == "null" ] && ContRestartStack=""
|
||||
|
||||
# Checking if compose-values are empty - hence started with docker run
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue