File tree 2 files changed +11
-9
lines changed
2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ VPN_MARKER_FILE="/tmp/coder_vpn_was_running"
6
6
# Before this script, or the user, opens the app, make sure
7
7
# Gatekeeper has ingested the notarization ticket.
8
8
spctl -avvv " /Applications/Coder Desktop.app"
9
- # spctl can't assess non-apps, so this will always return a non-zero exit code,
10
- # but the error message implies at minimum the signature of the extension was
11
- # checked.
9
+ # spctl can't assess non-apps, so this will always return a non-zero exit code,
10
+ # but the error message implies at minimum the signature of the extension was
11
+ # checked.
12
12
spctl -avvv " /Applications/Coder Desktop.app/Contents/Library/SystemExtensions/com.coder.Coder-Desktop.VPN.systemextension" || true
13
13
14
14
# Restart Coder Desktop if it was running before
@@ -24,7 +24,7 @@ if [ -f "$VPN_MARKER_FILE" ]; then
24
24
echo " Restarting CoderVPN..."
25
25
echo " Sleeping for 3..."
26
26
sleep 3
27
- scutil --nc start " Coder"
27
+ scutil --nc start " $( scutil --nc list | grep " com.coder. Coder-Desktop " | awk -F ' " ' ' {print $2} ' ) "
28
28
rm " $VPN_MARKER_FILE "
29
29
echo " CoderVPN started."
30
30
fi
Original file line number Diff line number Diff line change @@ -9,20 +9,22 @@ if pgrep 'Coder Desktop'; then
9
9
touch $RUNNING_MARKER_FILE
10
10
fi
11
11
12
+ vpnName=$( scutil --nc list | grep " com.coder.Coder-Desktop" | awk -F' "' ' {print $2}' )
13
+
12
14
echo " Turning off VPN"
13
- if scutil --nc list | grep -q " Coder " ; then
15
+ if [[ -n " $vpnName " ]] ; then
14
16
echo " CoderVPN found. Stopping..."
15
- if scutil --nc status " Coder " | grep -q " ^Connected$" ; then
17
+ if scutil --nc status " $vpnName " | grep -q " ^Connected$" ; then
16
18
touch $VPN_MARKER_FILE
17
19
fi
18
- scutil --nc stop " Coder "
20
+ scutil --nc stop " $vpnName "
19
21
20
22
# Wait for VPN to be disconnected
21
- while scutil --nc status " Coder " | grep -q " ^Connected$" ; do
23
+ while scutil --nc status " $vpnName " | grep -q " ^Connected$" ; do
22
24
echo " Waiting for VPN to disconnect..."
23
25
sleep 1
24
26
done
25
- while scutil --nc status " Coder " | grep -q " ^Disconnecting$" ; do
27
+ while scutil --nc status " $vpnName " | grep -q " ^Disconnecting$" ; do
26
28
echo " Waiting for VPN to complete disconnect..."
27
29
sleep 1
28
30
done
You can’t perform that action at this time.
0 commit comments