Skip to content

Instantly share code, notes, and snippets.

@jamesbrink
Created April 30, 2016 02:11
Show Gist options
  • Save jamesbrink/115a16bc2aecac4bcc4d57c843124d74 to your computer and use it in GitHub Desktop.
Save jamesbrink/115a16bc2aecac4bcc4d57c843124d74 to your computer and use it in GitHub Desktop.
GoDaddy VPN

Simple script to quickly connect to GoDaddy VPN on OSX

requires stoken Very basic and naive, not sure how to capture the vpn dialog window so we use a sleep 👍

Hint, PIN aka $1 could be included into function risking some security.. not much though.

¯\_(ツ)_/¯

vpn(){
  if [ -z $1 ]; then
  	echo "Usage: vpn [PIN]"
  	return 128
  else
  	scutil --nc start "GoDaddy Corp VPN"
  	password=`echo $1|stoken|grep '^\d'|tr -d '\n'`
  	sleep 2
  	osascript -e "tell application \"System Events\" to keystroke \"$password\""
  	osascript -e "tell application \"System Events\" to keystroke return"
  fi
}
@jamesbrink
Copy link
Author

out

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