From 558e8735b57c0383328927ea0e16a58cfe80cf59 Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Thu, 19 Mar 2026 12:49:33 +0100 Subject: [PATCH] mastercontainer: create the nextcloud-aio network during start.sh and attach mastercontainer to it Signed-off-by: Simon L. --- Containers/mastercontainer/start.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index d2420f24..6de07cc6 100644 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -175,6 +175,22 @@ This is not supported since the built-in backup solution will not work in that c exit 1 fi +# Create docker network +if ! sudo -E -u www-data docker network ls --format '{{.Name}}' | grep -q '^nextcloud-aio$'; then + if ! sudo -E -u www-data docker network create nextcloud-aio --driver bridge >/dev/null; then + print_red "Could not create the nextcloud-aio network. Exiting." + exit 1 + fi +fi + +# Add mastercontainer to nextcloud-aio network +if ! sudo -E -u www-data docker network inspect nextcloud-aio --format '{{ range .Containers }}{{ .Name }} {{ end }}' | grep -q ' nextcloud-aio-mastercontainer '; then + if ! sudo -E -u www-data docker network connect nextcloud-aio nextcloud-aio-mastercontainer >/dev/null; then + print_red "Could not attach the nextcloud-aio network to the mastercontainer. Exiting." + exit 1 + fi +fi + # Check for other options if [ -n "$NEXTCLOUD_DATADIR" ]; then if [ "$NEXTCLOUD_DATADIR" = "nextcloud_aio_nextcloud_datadir" ]; then