From 6c006a10ed3950df6b8bf977a81b85bc14e30c8e Mon Sep 17 00:00:00 2001 From: Farid Musa Date: Mon, 1 Jan 2024 22:22:13 +0400 Subject: [PATCH] fixes --- start.d/internal_dns.sh | 4 ++-- stop.d/internal_dns.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/start.d/internal_dns.sh b/start.d/internal_dns.sh index e01c885..7792827 100644 --- a/start.d/internal_dns.sh +++ b/start.d/internal_dns.sh @@ -6,9 +6,9 @@ if [ "$dns_container_id" != "" ]; then echo "Found running DNS container $dns_container_id" existing_network_name="$(docker inspect "$dns_container_id" | jq -r '.[0].NetworkSettings.Networks | keys | .[0] ')" echo "Found network '$existing_network_name' connected to '$dns_container_id'" - vpn_container_id="$(docker ps | grep "${OVPN_COMPOSE_NAME}_openvpn-1" | awk '{ print $1 }' 2> /dev/null)" + vpn_container_id="$(docker ps | grep "${OVPN_COMPOSE_NAME}" | grep "openvpn" | awk '{ print $1 }' 2> /dev/null)" echo "Connecting network '$existing_network_name' to $vpn_container_id" docker network connect "$existing_network_name" "$vpn_container_id" - echo "Connecting network '${OVPN_COMPOSE_NAME}_ovpn-net' to $dns_container_id" + echo "Connecting network '${OVPN_COMPOSE_NAME}' to $dns_container_id" docker network connect "${OVPN_COMPOSE_NAME}_ovpn-net" "$dns_container_id" fi diff --git a/stop.d/internal_dns.sh b/stop.d/internal_dns.sh index 5a1829d..9dac2d5 100644 --- a/stop.d/internal_dns.sh +++ b/stop.d/internal_dns.sh @@ -6,7 +6,7 @@ if [ "$dns_container_id" != "" ]; then echo "Found running DNS container $dns_container_id" existing_network_name="$(docker inspect "$dns_container_id" | jq -r '.[0].NetworkSettings.Networks | keys | .[0] ')" echo "Found network '$existing_network_name' connected to '$dns_container_id'" - vpn_container_id="$(docker ps | grep "${OVPN_COMPOSE_NAME}_openvpn-1" | awk '{ print $1 }' 2> /dev/null)" + vpn_container_id="$(docker ps | grep "${OVPN_COMPOSE_NAME}" | grep "openvpn" | awk '{ print $1 }' 2> /dev/null)" echo "Disconnecting network '$existing_network_name' to $vpn_container_id" docker network disconnect "$existing_network_name" "$vpn_container_id" echo "Disconnecting network '${OVPN_COMPOSE_NAME}_ovpn-net' to $dns_container_id"