From 8d884be33f3992c778b3eed0f1abd4806e1ad3b6 Mon Sep 17 00:00:00 2001 From: Arif Er Date: Fri, 24 Jun 2022 16:53:19 +0800 Subject: [PATCH] Add feature to remove cached icons when spinning down project The changes in this commit ensures that cached icons are removed from the server so that changes made to the `net.unraid.docker.icon` are respected. --- source/compose.manager/scripts/compose.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 ;;