diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index 7dc94809abd..9f73e47f5b9 100644 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -200,6 +200,12 @@ It needs to be a string with letters, numbers, hyphens and underscores. It is set to '$APACHE_ADDITIONAL_NETWORK'." exit 1 fi + if ! tmp_out=$(sudo -u www-data docker network connect "$APACHE_ADDITIONAL_NETWORK" nextcloud-aio-mastercontainer 2>&1); then + if [[ ! "$tmp_out" == *"nextcloud-aio-mastercontainer already exists in network $APACHE_ADDITIONAL_NETWORK"* ]]; then + print_red "Unable to connect to $APACHE_ADDITIONAL_NETWORK, cannot continue. Error: $tmp_out" + exit 1 + fi + fi fi if [ -n "$TALK_PORT" ]; then if ! check_if_number "$TALK_PORT"; then diff --git a/php/src/Docker/DockerActionManager.php b/php/src/Docker/DockerActionManager.php index 89385a11bc7..2500814ff32 100644 --- a/php/src/Docker/DockerActionManager.php +++ b/php/src/Docker/DockerActionManager.php @@ -901,6 +901,11 @@ public function ConnectMasterContainerToNetwork() : void $this->ConnectContainerIdToNetwork('nextcloud-aio-mastercontainer', ''); // Don't disconnect here since it slows down the initial login by a lot. Is getting done during cron.sh instead. // $this->DisconnectContainerFromBridgeNetwork('nextcloud-aio-mastercontainer'); + + $apacheAdditionalNetwork = $this->configurationManager->GetApacheAdditionalNetwork(); + if ($apacheAdditionalNetwork !== '') { + $this->ConnectContainerIdToNetwork('nextcloud-aio-mastercontainer', '', $apacheAdditionalNetwork, false); + } } public function ConnectContainerToNetwork(Container $container) : void