From 914da63984a758f16f4355b577cdee73530d4b06 Mon Sep 17 00:00:00 2001 From: TechHutTV Date: Tue, 25 Aug 2026 15:32:52 +0200 Subject: [PATCH] Overlap error now detects prior install --- infrastructure_files/getting-started.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/infrastructure_files/getting-started.sh b/infrastructure_files/getting-started.sh index 9cf9adb87..505aff3b8 100755 --- a/infrastructure_files/getting-started.sh +++ b/infrastructure_files/getting-started.sh @@ -523,9 +523,19 @@ check_docker_subnet_conflicts() { fi elif cidrs_overlap "$DOCKER_SUBNET" "$subnet"; then echo "ERROR: the existing Docker network '$name' ($subnet) overlaps $DOCKER_SUBNET, the subnet NetBird would use." > /dev/stderr - echo "That network is not managed by this script and is left untouched." > /dev/stderr - echo "Pick a free /24 for NetBird instead and run this script again:" > /dev/stderr - echo " NETBIRD_DOCKER_SUBNET=10.123.45.0/24 ./getting-started.sh" > /dev/stderr + # Every network this script creates is named _netbird, so that + # suffix means a NetBird install in another directory rather than an + # unrelated network. Suggesting a different subnet there would not help: + # the container names are fixed, so a second install collides regardless. + if [[ "$name" == *_netbird ]]; then + echo "That network was created by a NetBird install in a different directory." > /dev/stderr + echo "Run this script from that directory instead, or remove the old install first." > /dev/stderr + echo "Find it with: docker network inspect $name" > /dev/stderr + else + echo "That network is not managed by this script and is left untouched." > /dev/stderr + echo "Pick a free /24 for NetBird instead and run this script again:" > /dev/stderr + echo " NETBIRD_DOCKER_SUBNET=10.123.45.0/24 ./getting-started.sh" > /dev/stderr + fi exit 1 fi done