I got it working pretty good now. I put a unique string at the end of my cmds variable and changed the timeout to 240 right before when the commands are sent.
expect << EOF
set timeout 60
set var "exit "
log_user 0
spawn telnet ${router}
expect "login: "
send "testusername\r"
expect...
I am having issues with an expect script used in a bash script. How it functions is my bash script receives form post data with a list of commands and a list of routers to process the commands on and the lists are sent to variables. The expect script telnets to each router on the list and pushes...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.