diff --git a/pkgbuild/scripts/postinstall b/pkgbuild/scripts/postinstall index cdab83b..758776f 100755 --- a/pkgbuild/scripts/postinstall +++ b/pkgbuild/scripts/postinstall @@ -1,7 +1,6 @@ #!/usr/bin/env bash RUNNING_MARKER_FILE="/tmp/coder_desktop_running" -VPN_MARKER_FILE="/tmp/coder_vpn_was_running" # Before this script, or the user, opens the app, make sure # Gatekeeper has ingested the notarization ticket. @@ -19,14 +18,4 @@ if [ -f "$RUNNING_MARKER_FILE" ]; then echo "Coder Desktop started." fi -# Restart VPN if it was running before -if [ -f "$VPN_MARKER_FILE" ]; then - echo "Restarting CoderVPN..." - echo "Sleeping for 3..." - sleep 3 - scutil --nc start "$(scutil --nc list | grep "com.coder.Coder-Desktop" | awk -F'"' '{print $2}')" - rm "$VPN_MARKER_FILE" - echo "CoderVPN started." -fi - exit 0 diff --git a/pkgbuild/scripts/preinstall b/pkgbuild/scripts/preinstall index f4962e9..d52c133 100755 --- a/pkgbuild/scripts/preinstall +++ b/pkgbuild/scripts/preinstall @@ -1,9 +1,8 @@ #!/usr/bin/env bash RUNNING_MARKER_FILE="/tmp/coder_desktop_running" -VPN_MARKER_FILE="/tmp/coder_vpn_was_running" -rm $VPN_MARKER_FILE $RUNNING_MARKER_FILE || true +rm $RUNNING_MARKER_FILE || true if pgrep 'Coder Desktop'; then touch $RUNNING_MARKER_FILE @@ -14,9 +13,6 @@ vpn_name=$(scutil --nc list | grep "com.coder.Coder-Desktop" | awk -F'"' '{print echo "Turning off VPN" if [[ -n "$vpn_name" ]]; then echo "CoderVPN found. Stopping..." - if scutil --nc status "$vpn_name" | grep -q "^Connected$"; then - touch $VPN_MARKER_FILE - fi scutil --nc stop "$vpn_name" # Wait for VPN to be disconnected