Closed ganeshv closed 8 years ago
This is difficult for me to debug because I don't have a switch to test the scripts. However, you could try several options to try to solve yourselft the problem:
csblogin -d -c "config;exit" switch2
for {set i 0} {$i < $num_commands} { incr i} {
send "[lindex $commands $i]\r"
expect {
-re "^\[^\n\r *]*$prompt *$" {}
-re "^\[^\n\r]*$prompt." { exp_continue }
-re "(\r\n|\n)" { exp_continue }
}
}
Thanks. I already tried -d
but it was hopelessly verbose.
I tried changing that last regex case to
-re "\[\r\n]+" { exp_continue }
and it seems to work for both prompt-changing commands like config;exit
, config;vlan database;exit;exit
and regular commands like show cpu utilization; show cpu utilization
. Don't have a comprehensive list of test cases though.
csbrancid script launches csblogin script with commands "show system;show version;show startup-config". Could you verify your modified version of csblogin with these commands? If it is ok, I would upgrade the csblogin script with your modification.
solved with #18
Using an SG300, normal commands like
work fine. However, commands like
config
which change the prompt run into trouble. e.g.logins run, runs the command
config
and then gets stuck. Output: