1
0
Fork 0
mirror of synced 2024-11-16 22:25:33 -05:00
ovpn-admin/stop.d/internal_dns.sh
Farid Musa 9d21df39a4 fix
2024-01-01 21:59:29 +04:00

8 lines
329 B
Bash

#!/usr/bin/env bash
set -exo pipefail
dns_container_id="$(docker ps | grep "$OVPN_DNS_CONTAINER_NAME_PATTERN" | awk '{ print $1 }' 2> /dev/null)"
if [ "$dns_container_id" != "" ]; then
echo "Disconnecting network 'vpnet' from $dns_container_id"
docker network disconnect ${OVPN_COMPOSE_NAME}_ovpn-net "$dns_container_id"
fi