Created
January 16, 2018 16:28
-
-
Save kaazoo/d44bbf3ac1afdddb39b84b2c85b11f84 to your computer and use it in GitHub Desktop.
run_openconnect.scpt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set myfile to (POSIX file "/Users/MY_ACCOUNT/.vpn_pin") | |
open for access myfile | |
set vpn_pin to (read myfile) | |
close access myfile | |
set vpn_pin to text 1 thru -2 of vpn_pin | |
set vpn_token to text returned of (display dialog "Token:" default answer "") | |
tell application "Terminal" | |
do script "echo " & vpn_pin & vpn_token & " | sudo openconnect -v --authgroup MY_PROFILE -u MY_ACCOUNT --passwd-on-stdin MY_ENDPOINT" | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment