Created
December 28, 2018 10:45
-
-
Save stibi/20b0a5d496bdbd5073dde50662fa9b25 to your computer and use it in GitHub Desktop.
Open VPN connection, read oauth token from yubikey
This file contains hidden or 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 | |
set username "mstiborsky\r" | |
set config "/etc/openvpn/client/zonky.conf" | |
set vpn_oauth_token [exec ykman oath code -s vpn] | |
spawn openvpn --config $config --auth-user-pass | |
expect "Enter Auth Username:" | |
send $username | |
expect "Enter Auth Password:" | |
send $vpn_oauth_token | |
send "\r" | |
interact |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment