I am sending a command to the Mikrotik router using Telnet.
telnet 192.168.100.100 -l admin
Password: pass1234
[admin@ZYMMA] > /interface pppoe-server remove [find user=aspeed13]
[admin@ZYMMA] > quit
It works great.
Now I want to automate it using a wait tcl script:
spawn telnet 192.168.100.100
expect "Login:"
send "admin\r"
expect "Password:"
send "pass1234\r"
expect "\[admin@ZYMMA\] >"
send "/interface pppoe-server remove \[find user=aspeed13\]\r"
expect "\[admin@ZYMMA\] >"
send "quit\r"
It works, but after authentication (line 6:) send "pass1234\r"when loading the router CLI, it freezes for ~ 10 seconds with the following characters. ^[[?6c^[[24;3R
Then the scripts work fine.
My question is, why does Telnet load quickly when accessed manually and it takes too much time to access through expect script? I read in the forums about telnet automation, they say that telnet is slow, but since manually it is too fast, why does it take time to boot with a wait?
source
share