[PATCH 2/2] wg-quick: darwin: handle disabled interface

Loren McIntyre loren at mcint.io
Fri Jan 22 06:58:58 UTC 2021


---
 src/wg-quick/darwin.bash | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash
index 9c92f87..e9bdfea 100755
--- a/src/wg-quick/darwin.bash
+++ b/src/wg-quick/darwin.bash
@@ -296,7 +296,7 @@ set_dns() {
 	local service response
 	for service in "${!SERVICE_DNS[@]}"; do
 		while read -r response; do
-			[[ $response == *Error* ]] && echo "$response" >&2
+			[[ $response == *Error* || $response == *"disabled)" ]] && echo "$response" >&2
 		done < <(
 			cmd networksetup -setdnsservers "$service" "${DNS[@]}"
 			if [[ ${#DNS_SEARCH[@]} -eq 0 ]]; then
@@ -312,7 +312,7 @@ del_dns() {
 	local service response
 	for service in "${!SERVICE_DNS[@]}"; do
 		while read -r response; do
-			[[ $response == *Error* ]] && echo "$response" >&2
+			[[ $response == *Error* || $response == *"disabled)" ]] && echo "$response" >&2
 		done < <(
 			cmd networksetup -setdnsservers "$service" ${SERVICE_DNS["$service"]} || true
 			cmd networksetup -setsearchdomains "$service" ${SERVICE_DNS_SEARCH["$service"]} || true
-- 
2.29.2



More information about the WireGuard mailing list