Skip to content

Commit 0f519a9

Browse files
committed
Fix wireguard to detect launchd on Monterey
1 parent 52597c3 commit 0f519a9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/wg-quick/darwin.bash

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,13 @@ parse_options() {
8585
}
8686

8787
detect_launchd() {
88-
unset LAUNCHED_BY_LAUNCHD
89-
local line
90-
while read -r line; do
91-
if [[ $line =~ ^\s*domain\ =\ ]]; then
92-
LAUNCHED_BY_LAUNCHD=1
93-
break
94-
fi
88+
LAUNCHED_BY_LAUNCHD=1
89+
local line
90+
while read -r line; do
91+
if [[ $line =~ ^\s*\(pid\ $$\ is\ not\ managed\ by\ launchd\) ]]; then
92+
unset LAUNCHED_BY_LAUNCHD
93+
break
94+
fi
9595
done < <(launchctl procinfo $$ 2>/dev/null)
9696
}
9797

0 commit comments

Comments
 (0)