Skip to content

Commit

Permalink
Fix wireguard to detect launchd on Monterey
Browse files Browse the repository at this point in the history
  • Loading branch information
palmerc committed Aug 10, 2021
1 parent 52597c3 commit 0f519a9
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/wg-quick/darwin.bash
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ parse_options() {
}

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

Expand Down

0 comments on commit 0f519a9

Please sign in to comment.