2
rated 0 times
[
2]
[
0]
/ answers: 1 / hits: 3445
/ 6 Months ago, wed, april 5, 2023, 7:29:01
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?
More From » command-line