Development discussion of WireGuard
 help / color / mirror / Atom feed
From: Loren McIntyre <loren@mcint.io>
To: wireguard@lists.zx2c4.com
Cc: Loren McIntyre <loren@mcint.io>
Subject: [PATCH 2/2] wg-quick: darwin: handle disabled interface
Date: Thu, 21 Jan 2021 22:58:58 -0800	[thread overview]
Message-ID: <20210122065858.41605-2-loren@mcint.io> (raw)
In-Reply-To: <20210122065858.41605-1-loren@mcint.io>

---
 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


      reply	other threads:[~2021-01-24 16:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-22  6:57 wg-quick: darwin: DNS cleanup & disabled/inactive interface causing setup to fail Loren McIntyre
2021-01-22  6:58 ` [PATCH 1/2] wg-quick: darwin: restore original dns settings on failed up Loren McIntyre
2021-01-22  6:58   ` Loren McIntyre [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210122065858.41605-2-loren@mcint.io \
    --to=loren@mcint.io \
    --cc=wireguard@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).