Skip to content

Commit 8bd0145

Browse files
committed
Add support for swag-ondemand
1 parent 332f651 commit 8bd0145

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

root/app/auto-proxy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
#!/usr/bin/with-contenv bash
22

33
AUTO_GEN=""
4+
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}}")
45
# figure out which containers to generate confs for or which confs to remove
56
if [ ! -f /auto-proxy/enabled_containers ]; then
6-
docker ps --filter "label=swag=enable" --format "{{.Names}}" > /auto-proxy/enabled_containers
7+
echo "${ENABLED_CONTAINERS}" > /auto-proxy/enabled_containers
78
AUTO_GEN=$(cat /auto-proxy/enabled_containers)
89
else
9-
ENABLED_CONTAINERS=$(docker ps --filter "label=swag=enable" --format "{{.Names}}")
1010
for CONTAINER in ${ENABLED_CONTAINERS}; do
1111
if [ ! -f "/auto-proxy/${CONTAINER}.conf" ]; then
1212
echo "**** New container ${CONTAINER} detected, will generate new conf. ****"

0 commit comments

Comments
 (0)