mirror of
https://github.com/mag37/dockcheck.git
synced 2026-04-17 09:57:49 +00:00
sort + compose-path
Added alphabetical sorting to the lists. Changed the path accessing the compose-file to be referencing the **actual** compose-file, not just the working dir. That way allowing people to have different naming-schemes for their composes.
This commit is contained in:
14
dockcheck.sh
14
dockcheck.sh
@@ -1,5 +1,5 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
### VERSION v.0.1.0
|
### VERSION v.0.1.1
|
||||||
|
|
||||||
### Help Function:
|
### Help Function:
|
||||||
Help() {
|
Help() {
|
||||||
@@ -100,6 +100,12 @@ for i in $(docker ps --filter "name=$SearchName" --format '{{.Names}}') ; do
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
### Sort arrays alphabetically
|
||||||
|
IFS=$'\n'
|
||||||
|
NoUpdates=($(sort <<<"${NoUpdates[*]}"))
|
||||||
|
GotUpdates=($(sort <<<"${GotUpdates[*]}"))
|
||||||
|
GotErrors=($(sort <<<"${GotErrors[*]}"))
|
||||||
|
unset IFS
|
||||||
### Create new Array to use for the numbered list:
|
### Create new Array to use for the numbered list:
|
||||||
NumberedUpdates=(ALL "${GotUpdates[@]}")
|
NumberedUpdates=(ALL "${GotUpdates[@]}")
|
||||||
|
|
||||||
@@ -129,9 +135,9 @@ if [ -n "$GotUpdates" ] ; then
|
|||||||
if [ "$UpdYes" != "${UpdYes#[Yy]}" ] ; then
|
if [ "$UpdYes" != "${UpdYes#[Yy]}" ] ; then
|
||||||
for i in "${SelectedUpdates[@]}"
|
for i in "${SelectedUpdates[@]}"
|
||||||
do
|
do
|
||||||
ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.working_dir"}}')
|
ContPath=$(docker inspect "$i" --format '{{ index .Config.Labels "com.docker.compose.project.config_files"}}')
|
||||||
$DockerBin -f "$ContPath/docker-compose.yml" pull
|
$DockerBin -f "$ContPath" pull
|
||||||
$DockerBin -f "$ContPath/docker-compose.yml" up -d
|
$DockerBin -f "$ContPath" up -d
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
printf "\nNo updates installed, exiting.\n"
|
printf "\nNo updates installed, exiting.\n"
|
||||||
|
|||||||
Reference in New Issue
Block a user