Skip to content

Instantly share code, notes, and snippets.

@moonwatcher
Last active August 26, 2015 22:04
Show Gist options
  • Save moonwatcher/c2a8a569862bdfbf6904 to your computer and use it in GitHub Desktop.
Save moonwatcher/c2a8a569862bdfbf6904 to your computer and use it in GitHub Desktop.

##/Library/LaunchDaemons/org.vpn.nyu.plist

<?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>org.vpn.nyu</string>

  <key>ProgramArguments</key>
  <array>
    <string>/usr/local/etc/openconnect/nyu</string>
    <string>--quiet</string>
  </array>

  <key>OnDemand</key>
  <false/>  
  <key>RunAtLoad</key>
  <true/>
  <key>KeepAlive</key>
  <true/>
  
  <key>TimeOut</key>
  <integer>90</integer>

  <key>StandardErrorPath</key>
  <string>/var/log/vpn/nyu.log</string>
  <key>StandardOutPath</key>
  <string>/var/log/vpn/nyu.log</string>
</dict>
</plist>

/usr/local/etc/openconnect/nyu

USER="<your nyuid>"
PASSWORD="<your nyu password>"

SERVER="vpn.nyu.edu"

echo "$PASSWORD" | /usr/local/bin/openconnect --passwd-on-stdin --user $USER --authgroup nyu-vpn "$SERVER"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment