#!/usr/bin/expect -f
set timeout -1
set TARROOTLABEL "root@CRong:/#"
##############################################
spawn telnet 192.168.1.211
expect "login:"
send "root\n"
expect "Password:"
send "crc616\n"
expect $TARROOTLABEL
send "ping 1.1.1.251\n"
send_user "\n\nOver\n\n"
interact
##############################################
set timeout -1
set TARROOTLABEL "root@CRong:/#"
##############################################
spawn telnet 192.168.1.211
expect "login:"
send "root\n"
expect "Password:"
send "crc616\n"
expect $TARROOTLABEL
send "ping 1.1.1.251\n"
send_user "\n\nOver\n\n"
interact
##############################################