From f0940e81ec08a9e307741ca25461e296cc2d45e6 Mon Sep 17 00:00:00 2001 From: mag37 Date: Tue, 27 Jun 2023 19:34:20 +0200 Subject: [PATCH] Fixes to the Exclude-option to only exclude exact matches, instead of wildcarding and excluding by mistake. Added a counter + message about which container updating. --- dockcheck.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dockcheck.sh b/dockcheck.sh index dc13da5..8726f2b 100755 --- a/dockcheck.sh +++ b/dockcheck.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash VERSION="v0.2.4" -### ChangeNotes: Fixes to the Exclude-option to only exclude exact matches. +### ChangeNotes: Fixes to the Exclude-option to only exclude exact matches. +cleaning Github="https://github.com/mag37/dockcheck" RawUrl="https://raw.githubusercontent.com/mag37/dockcheck/main/dockcheck.sh" @@ -208,8 +208,11 @@ if [ -n "$GotUpdates" ] ; then SelectedUpdates=( "${GotUpdates[@]}" ) fi if [ "$UpdYes" == "${UpdYes#[Nn]}" ] ; then + NumberofUpdates="${#SelectedUpdates[@]}" + CurrentQue=0 for i in "${SelectedUpdates[@]}" do + ((CurrentQue+=1)) unset CompleteConfs ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir" }}') ContConfigFile=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files" }}') @@ -234,6 +237,7 @@ if [ -n "$GotUpdates" ] ; then fi ### cd to the compose-file directory to account for people who use relative volumes, eg - ${PWD}/data:data cd "$ContPath" || { echo "Path error - skipping $i" ; continue ; } + printf "\n\033[0;36mNow updating (%s/%s): \033[0;34m%s\033[0m\n" "$CurrentQue" "$NumberofUpdates" "$i" docker pull "$ContImage" ### Reformat for multi-compose: IFS=',' read -r -a Confs <<< "$ComposeFile" ; unset IFS