[Level 2] Use expect to run openvpn.
#!/usr/bin/expect set password [lindex $argv 0] spawn sudo openvpn --script-security 2 --config /home/stanley/VPN/MyVPN_config/MyVPN.ovpn expect Enter\ Private\ Key\ Password: sleep 1 send $password sleep 1 interactTest run:
# ./openvpn.expect mypasswordWish this helps.
regards,
Stanley Huang
Comments
Post a Comment