我有TCL代码,我想循环以防万一我收到"连接由外国主机关闭"
Telnet to routem PC
connect sys -match_max 500000 "telnet $linux_machine $port"
# using the system passed login credentials
receive sys {login:} 120
sleep 5
transmit sys "$ta_user_id\r"
receive sys {Password: $}
transmit sys "$ta_user_passwd\r"
receive sys {%$}
transmit sys "su\r"
receive sys {Password: $} 20
transmit sys "$root_passwd\r"
日志 故障情景日志
++++ 05:13:50 sys Control::connect +++
Connect: sys -match_max 500000 {telnet ssr-lnx-iol 5012}
+--- 05:13:50 ---
++++ 05:13:50 sys Control::receive +++
Trying 172.25.195.183...
Connected to ssr-lnx-iol.
Escape character is '^]'.
Fedora release 9 (Sulphur)
Kernel 2.6.25-14.fc9.i686 on an i686 (0)
login:
--- 05:14:01 ---
++++ 05:14:06 sys Control::transmit +++
Transmit: root
+--- 05:14:06 ---
++++ 05:14:06 sys Control::receive +++
root
Password:
devtest-
Connection closed by foreign host.