From 974ad1ef9b0875b0c62a8f266867724818aa038f Mon Sep 17 00:00:00 2001 From: Apoorv Parle <19315187+apparle@users.noreply.github.com> Date: Mon, 4 Nov 2024 05:27:30 -0800 Subject: [PATCH] Improve error checking and connect mastercontainer right from the start to make inital process seamless. Signed-off-by: Apoorv Parle <19315187+apparle@users.noreply.github.com> --- Containers/mastercontainer/start.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Containers/mastercontainer/start.sh b/Containers/mastercontainer/start.sh index 7dc94809..cbf79d75 100644 --- a/Containers/mastercontainer/start.sh +++ b/Containers/mastercontainer/start.sh @@ -200,6 +200,11 @@ It needs to be a string with letters, numbers, hyphens and underscores. It is set to '$APACHE_ADDITIONAL_NETWORK'." exit 1 fi + tmp_out=$(sudo -u www-data docker network connect $APACHE_ADDITIONAL_NETWORK nextcloud-aio-mastercontainer 2>&1) + if [ -n "$tmp_out" ] && [[ ! "$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: \n $tmp_out" + exit 1 + fi fi if [ -n "$TALK_PORT" ]; then if ! check_if_number "$TALK_PORT"; then