mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-21 03:40:39 +00:00
cleaned old jq check + fixed some naming
This commit is contained in:
+7
-13
@@ -229,7 +229,7 @@ else
|
|||||||
read -r -p "Required dependency 'regctl' missing, do you want it downloaded? y/[n] " GetRegctl
|
read -r -p "Required dependency 'regctl' missing, do you want it downloaded? y/[n] " GetRegctl
|
||||||
if [[ "$GetRegctl" =~ [yY] ]] ; then
|
if [[ "$GetRegctl" =~ [yY] ]] ; then
|
||||||
binary_downloader "regctl" "https://github.com/regclient/regclient/releases/latest/download/regctl-linux-TEMP"
|
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 ;
|
else printf "%s\n" "Dependency missing, quitting." ; exit 1 ;
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@@ -247,12 +247,6 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
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
|
# Numbered List function
|
||||||
options() {
|
options() {
|
||||||
num=1
|
num=1
|
||||||
@@ -352,17 +346,17 @@ if [ -n "$GotUpdates" ] ; then
|
|||||||
# Extract labels and metadata
|
# Extract labels and metadata
|
||||||
ContLabels=$(docker inspect "$i" --format '{{json .Config.Labels}}')
|
ContLabels=$(docker inspect "$i" --format '{{json .Config.Labels}}')
|
||||||
ContImage=$(docker inspect "$i" --format='{{.Config.Image}}')
|
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=""
|
[ "$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=""
|
[ "$ContConfigFile" == "null" ] && ContConfigFile=""
|
||||||
ContName=$(jq -r '."com.docker.compose.service"' <<< "$ContLabels")
|
ContName=$(jqbin -r '."com.docker.compose.service"' <<< "$ContLabels")
|
||||||
[ "$ContName" == "null" ] && ContName=""
|
[ "$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=""
|
[ "$ContEnv" == "null" ] && ContEnv=""
|
||||||
ContUpdateLabel=$(jq -r '."mag37.dockcheck.update"' <<< "$ContLabels")
|
ContUpdateLabel=$(jqbin -r '."mag37.dockcheck.update"' <<< "$ContLabels")
|
||||||
[ "$ContUpdateLabel" == "null" ] && ContUpdateLabel=""
|
[ "$ContUpdateLabel" == "null" ] && ContUpdateLabel=""
|
||||||
ContRestartStack=$(jq -r '."mag37.dockcheck.restart-stack"' <<< "$ContLabels")
|
ContRestartStack=$(jqbin -r '."mag37.dockcheck.restart-stack"' <<< "$ContLabels")
|
||||||
[ "$ContRestartStack" == "null" ] && ContRestartStack=""
|
[ "$ContRestartStack" == "null" ] && ContRestartStack=""
|
||||||
|
|
||||||
# Checking if compose-values are empty - hence started with docker run
|
# Checking if compose-values are empty - hence started with docker run
|
||||||
|
|||||||
Reference in New Issue
Block a user