#!/usr/bin/expect -f
spawn telnet 10.21.0.17
expect -re \"login\"
send \"admin\\n\"
expect -re \"Password\"
send \"supersecurepassword\\n\"
interact
<
This was resolved by simply adding a sleep before the expect, and of course not including interact, the following works well:
#!/usr/bin/expect -f
spawn telnet 10.21.0.17
expect -re "login"
send "admin\n"
expect -re "Password"
send "supersecurepassword\n"
sleep 5
expect "WAP"
send "reboot\n"
send "exit\n"
For reference, this was used to automate a reboot on a D-Link DAP-2590 wireless access point. Now that I know this though, I may use it for other things: changing passwords, etc. Hope it helps someone else in the future.