Quantcast
Channel: Active questions tagged expect - Unix & Linux Stack Exchange
Viewing all articles
Browse latest Browse all 159

Expect script hanging

$
0
0

I'm trying to use expect to automate my login process in ovpn but due to some mistake it is not going well. My script:

#!/usr/bin/expect -fset timeout -1spawn openvpn --config ./bin/openvpn-lib/cert.ovpn --dev ovpntun0 --up ./bin/openvpn-  lib/update-resolv.conf --down ./bin/openvpn-lib/update-resolv.conf --script-security 2expect "Enter Auth Username:"send "myuser\n"expect "Enter Auth Password:"send "mypass\n"interact

WHen I try to run it the scriptit reports the following error:

vpn_expect.sh: line 4: spawn: command not foundcouldn't read file "Enter Auth Username:": no such file or directoryvpn_expect.sh: line 8: send: command not foundcouldn't read file "Enter Auth Password:": no such file or directoryvpn_expect.sh: line 12: send: command not foundvpn_expect.sh: line 14: interact: command not foundvfbsilva@rohan ~ $ 

Viewing all articles
Browse latest Browse all 159

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>