From 8bd01457d1fd218b860dea40202145d6cb580cdf Mon Sep 17 00:00:00 2001 From: quietsy Date: Sun, 23 Nov 2025 14:08:24 +0200 Subject: [PATCH] Add support for swag-ondemand --- root/app/auto-proxy.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/root/app/auto-proxy.sh b/root/app/auto-proxy.sh index 875337d..3e8578b 100755 --- a/root/app/auto-proxy.sh +++ b/root/app/auto-proxy.sh @@ -1,12 +1,12 @@ #!/usr/bin/with-contenv bash AUTO_GEN="" +ENABLED_CONTAINERS=$(docker ps -f "label=swag=enable" --format "{{.Names}}" && docker ps -a -f "status=exited" -f "label=swag=enable" -f "label=swag_ondemand=enable" --format "{{.Names}}") # figure out which containers to generate confs for or which confs to remove if [ ! -f /auto-proxy/enabled_containers ]; then - docker ps --filter "label=swag=enable" --format "{{.Names}}" > /auto-proxy/enabled_containers + echo "${ENABLED_CONTAINERS}" > /auto-proxy/enabled_containers AUTO_GEN=$(cat /auto-proxy/enabled_containers) else - ENABLED_CONTAINERS=$(docker ps --filter "label=swag=enable" --format "{{.Names}}") for CONTAINER in ${ENABLED_CONTAINERS}; do if [ ! -f "/auto-proxy/${CONTAINER}.conf" ]; then echo "**** New container ${CONTAINER} detected, will generate new conf. ****"