diff --git a/source/compose.manager/scripts/compose.sh b/source/compose.manager/scripts/compose.sh index 759e161..4d3b090 100755 --- a/source/compose.manager/scripts/compose.sh +++ b/source/compose.manager/scripts/compose.sh @@ -1,7 +1,10 @@ #!/bin/bash export HOME=/root -export DOCKER_JSON=/usr/local/emhttp/state/plugins/dynamix.docker.manager/docker.json +DOCKER_MANAGER=/usr/local/emhttp/state/plugins/dynamix.docker.manager +DOCKER_JSON=$DOCKER_MANAGER/docker.json +DOCKER_IMAGES=$DOCKER_MANAGER/images +UNRAID_IMAGES=/var/lib/docker/unraid/images case $1 in @@ -9,6 +12,8 @@ case $1 in docker compose -f "$2" -p "$3" ps -a | awk '{if (NR!=1) {printf("%s.\"%s\"", sep, $1); sep=", "}}' | xargs -0 -I {} jq 'del({})' $DOCKER_JSON > $DOCKER_JSON + docker compose -f "$2" -p "$3" ps -a | + xargs -I {} find $DOCKER_IMAGES $UNRAID_IMAGES -name {}.png -delete docker compose -f "$2" -p "$3" up -d 2>&1 ;; @@ -16,6 +21,8 @@ case $1 in docker compose -f "$2" -p "$3" ps -a | awk '{if (NR!=1) {printf("%s.\"%s\"", sep, $1); sep=", "}}' | xargs -0 -I {} jq 'del({})' $DOCKER_JSON > $DOCKER_JSON + docker compose -f "$2" -p "$3" ps -a | + xargs -I {} find $DOCKER_IMAGES $UNRAID_IMAGES -name {}.png -delete docker compose -f "$2" -p "$3" down 2>&1 ;;