I've also tried several other scripts, including YazzY's script. They all show the exact same thing: They log into the Mikrotik properly, and then accomplish nothing. I see no commands or responses sent, and the Mikrotik logs out.
Code: Select all
#!/usr/bin/expect # spawn /usr/bin/ssh 22.214.171.124 -l admin expect -re "password:" send "password\r" # expect ">" send "system resource print\n" sleep 2 # expect -re "] > " send "print"
I've tried pointing the script at a local Linux server, and it works properly - I see the commands & responses.