desktop/scripts/vpnpass
illustris 6c559efe66 init
2021-03-05 07:02:38 +05:30

16 lines
389 B
Plaintext
Executable File

#!/usr/bin/env expect
set conf [lindex $argv 0];
set user [lindex $argv 1];
set pass_pw [lindex $argv 2];
set pass_otp [lindex $argv 3];
spawn sudo openvpn --config $conf
expect "Enter Auth Username:"
send "$user\n"
expect "Enter Auth Password:"
set pw [exec pass "$pass_pw"]
send "$pw\n"
expect "Enter Google Authenticator Code"
set otp [exec pass otp "$pass_otp"]
send "$otp\n"
interact