Last active
October 17, 2019 07:47
-
-
Save 1stvamp/d95697cbd8f8e635a16c77783da52f7e to your computer and use it in GitHub Desktop.
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
#!/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 |
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
#!/bin/bash | |
set -eo pipefail | |
TOKEN=$(ykman oath code -s 'Swiftype VPN') | |
read -srep 'PIN: ' PIN | |
~/bin/connect-vpn.expect "${PIN}" "${TOKEN}" | |
echo |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment