hello!
i have some ssh script:
#!/bin/sh
ssh -i /bla/bla/dsa some_login@10.10.10.1 “/ip firewall address-list add address=$1 list=1M comment=$2”
but because of the problem with mikrotik ssh server, i want to do the same, but with the help of telnet. So i’ve created this:
!/bin/sh
user_add () {
(sleep 5; printf “password\n”; sleep 5; printf “/ip firewall address-list add address=$1 list=1M comment=$2\n” | telnet 10.10.10.2
}
user_add ${1} ${2}
so when i start the script:
[root@mega_servant /bla/bla/]# ./script.sh 10.10.3.3 test-user
Trying 10.55.31.1…
Connected to 10.55.31.1.
Escape character is ‘^]’.
Password:
MMM MMM KKK TTTTTTTTTTT KKK
MMMM MMMM KKK TTTTTTTTTTT KKK
MMM MMMM MMM III KKK KKK RRRRRR OOOOOO TTT III KKK KKK
MMM MM MMM III KKKKK RRR RRR OOO OOO TTT III KKKKK
MMM MMM III KKK KKK RRRRRR OOO OOO TTT III KKK KKK
MMM MMM III KKK KKK RRR RRR OOOOOO TTT III KKK KKK
MikroTik RouterOS 3.17 (c) 1999-2008 http://www.mikrotik.com/
(628 messages not shown)
^[[?1;2c^[[65;3RConnection closed by foreign host.
[root@billing /data/netup/utm5/scripts]# 1;2c5;3R
i see strange symbols((( and i don’t know what to do.
Please, can anybody help?