Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save kazuhisya/9d89b861ef015878c33be96f47d8f776 to your computer and use it in GitHub Desktop.
Save kazuhisya/9d89b861ef015878c33be96f47d8f776 to your computer and use it in GitHub Desktop.
wtf juniper. Anyone else find it irritating that junos pulse services and pulse tray must always running in OS X regardless of whether or not you're currently connected? Yeah, me too. I added the following as aliases to my shell to fix this problem. Be sure to change your /Library/LaunchAgents/net.juniper.pulsetray.plist file to reflect the `Kee…
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>net.juniper.pulsetray</string>
<key>LimitLoadToSessionType</key>
<array>
<string>Aqua</string>
</array>
<key>ProgramArguments</key>
<array>
<string>/Applications/Junos Pulse.app/Contents/Plugins/JamUI/PulseTray.app/Contents/MacOS/PulseTray</string>
</array>
<key>KeepAlive</key>
<false/>
<key>Disabled</key>
<false/>
</dict>
</plist>
#################################################################################
# start and stop the vpn from the command line from now on with these two commands
# or rename the aliases as you see fit.
#################################################################################
alias startvpn="sudo launchctl load -w /Library/LaunchDaemons/net.juniper.AccessService.plist; open -a '/Applications/Junos Pulse.app/Contents/Plugins/JamUI/PulseTray.app/Contents/MacOS/PulseTray'"
alias quitvpn="osascript -e 'tell application \"PulseTray.app\" to quit';sudo launchctl unload -w /Library/LaunchDaemons/net.juniper.AccessService.plist"
@kazuhisya
Copy link
Author

  1. edit /Library/LaunchAgents/net.juniper.pulsetray.plist
  2. edit .bashrc and $ source .bashrc
  3. run $ vpn-stop (first time only)
# ~~ snip ~~
# VPN
vpn-start() {
        sudo launchctl load -w /Library/LaunchDaemons/net.juniper.AccessService.plist
        launchctl load -w /Library/LaunchAgents/net.juniper.pulsetray.plist
}
vpn-stop() {
        launchctl unload -w /Library/LaunchAgents/net.juniper.pulsetray.plist
        sudo launchctl unload -w /Library/LaunchDaemons/net.juniper.AccessService.plist
        osascript -e 'tell application "Junos Pulse" to quit'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment