Skip to content

Instantly share code, notes, and snippets.



Last active Oct 17, 2019
What would you like to do?
#!/usr/bin/expect -f
set timeout -1
set pin [ lindex $argv 0 ]
set token [ lindex $argv 1 ]
spawn gotunl -c 1
expect "Enter the PIN:*"
send -- "$pin\r"
expect "Enter the OTP code:*"
send -- "$token\r"
expect eof
set -eo pipefail
TOKEN=$(ykman oath code -s 'Swiftype VPN')
read -srep 'PIN: ' PIN
~/bin/connect-vpn.expect "${PIN}" "${TOKEN}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment