Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions root/app/auto-proxy.sh
Original file line number Diff line number Diff line change
@@ -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. ****"
Expand Down