clogin -x fails when cisco prompt gets too long

Zhang, Anchi AZhang at reliant.com
Tue Feb 4 00:27:19 UTC 2003


It seems that clogin -x file will fail if the commands in file result in a
long prompt from the device.  In the following example,
"REP2970_Server(config-router)#" would be expected after "router eigrp 216"
was sent.  Shortening the hostname would make the script work.

log2% cat foo
#!/bin/sh

echo "conf t
router eigrp 216
eigrp log-neighbor-changes
end
wr mem" >/tmp/$$

clogin -x /tmp/$$ 10.51.2.51

rm /tmp/$$
log2% ./foo
10.51.2.51
spawn ssh -c 3des -x -l azhang 10.51.2.51
azhang at 10.51.2.51's password: 
REP2970_Server2B_L3>enable
Password: 
REP2970_Server2B_L3#
REP2970_Server2B_L3#term length 0
REP2970_Server2B_L3#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
REP2970_Server2B_L3(config)#router eigrp 216

Error: TIMEOUT reached
log2% 




More information about the Rancid-discuss mailing list