Jestli to chceš na mikrotiku oboje, a nevidíš tam parametr "password", tak bych řekl, že je poznat, že to nejde :-) Možná tím certifikátem (SSH keys), nevím jestli ho dokáže MK v tomhle případě použít.
A obecně - co napíšeš na terminálu, můžeš napsat i do scriptu.
Opět vidíme, k čemu vede uzavřený systém :-) Měl-li bych přístup do čisté konzole a mohl něco doinstalovat, použiju zmíněný Expect. Tam je to vcelku hodně elegantní ... Příklad:
#!/usr/bin/env /usr/bin/expect
# -*-tcl-*-
if { $argc != 4 } {
send_user "Usage : $argv0 <username> <switch> <pass> <tftpserver>\n"
exit
}
set timeout 60
set username
set switch
set password
set server
spawn telnet $switch
expect "Username:"
send "$username\r"
expect "Password:"
send "$password\r"
send "copy file tftp\r"
expect "Choose file type:"
send "1\r"
expect "Source file name:"
send "$switch.cfg\r"
expect "TFTP server IP address:"
send "$server\r"
expect "Destination file name:"
send "$switch.conf\r"
send "quit\r"
expect eof
exit 0