I am trying to automate my vpn using a shell scipt
What I want is to get a webpage (curl) and parse it for password. If I write a normal script looks something like:
var=$(curl -i http://www.vpnbook.com/freevpn | grep "Password: <strong>*")
echo ${var:26:8}
This outputs a password.
Now, I want to parse this via expect
, store it, and then run the openvpn
command:
spawn sudo openvpn --config vpnbook-euro2-tcp443.ovpn
expect "Enter Auth Username:"
send "vpnbook"
expect "Enter Password: "
send $pass
I am unable to set this pass
variable properly.
Any Ideas?