Stop namespace consumers before gateway replacement

This commit is contained in:
Mikei386
2026-09-01 11:00:46 +02:00
parent 16ac177782
commit 12392ccdd7
3 changed files with 27 additions and 10 deletions
+13 -8
View File
@@ -48,19 +48,24 @@ case "$command" in
shift
[[ $# -eq 0 ]] || { echo "core akzeptiert keine weiteren Services" >&2; exit 2; }
run "$ROOT_DIR/platform/mcp/install-tools.sh"
# Release the old gateway namespace (and its fixed network addresses)
# before replacing its owner. Otherwise Docker can strand the host with
# the old namespace still held by these two consumers.
run "${compose[@]}" stop llama-dashboard portainer
run "${compose[@]}" up -d --build \
wireguard-gateway piper xtts tts-gateway profile-controller router llama-dashboard portainer backup
# network_mode: service:wireguard-gateway stores the gateway container
# ID. Rebind namespace consumers after every gateway replacement.
run "${compose[@]}" up -d --no-deps --force-recreate llama-dashboard portainer
else
run "${compose[@]}" up -d --build --no-deps "$@"
rebind_gateway=false
for service in "$@"; do
if [[ $service == wireguard-gateway ]]; then
run "${compose[@]}" up -d --no-deps --force-recreate llama-dashboard portainer
break
fi
[[ $service == wireguard-gateway ]] && rebind_gateway=true
done
if [[ $rebind_gateway == true ]]; then
run "${compose[@]}" stop llama-dashboard portainer
fi
run "${compose[@]}" up -d --build --no-deps "$@"
if [[ $rebind_gateway == true ]]; then
run "${compose[@]}" up -d --no-deps --force-recreate llama-dashboard portainer
fi
fi
;;
purge-legacy)