Skip to content

Commit de363a2

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

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/wg-quick/darwin.bash

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

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

0 commit comments

Comments
 (0)