From c9adc6962aa2c4b4d379abf9df3bc59372930083 Mon Sep 17 00:00:00 2001 From: Cameron Lowell Palmer Date: Tue, 10 Aug 2021 16:10:54 +0200 Subject: [PATCH] Fix wireguard to detect launchd on Monterey --- src/wg-quick/darwin.bash | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/wg-quick/darwin.bash b/src/wg-quick/darwin.bash index c77441fa..1f03bb0b 100755 --- a/src/wg-quick/darwin.bash +++ b/src/wg-quick/darwin.bash @@ -85,11 +85,11 @@ parse_options() { } detect_launchd() { - unset LAUNCHED_BY_LAUNCHD + LAUNCHED_BY_LAUNCHD=1 local line while read -r line; do - if [[ $line =~ ^\s*domain\ =\ ]]; then - LAUNCHED_BY_LAUNCHD=1 + if [[ $line =~ "^\s*\(pid $$ is not managed by launchd\)" ]]; then + unset LAUNCHED_BY_LAUNCHD break fi done < <(launchctl procinfo $$ 2>/dev/null)