#!/bin/bash
for ip in `cat ip.txt`
do
{ echo "admin+t/r"; sleep 2; echo "pass"; sleep 2; echo "ping 192.168.20.35"; sleep 2; echo "quit" ;} | telnet $ip
done
dmitryg@dmitrys-mbp:~ $ ssh admin@mikrotik ping 192.168.109.1
admin@192.168.109.253's password:
SEQ HOST SIZE TTL TIME STATUS
0 192.168.109.1 56 64 0ms
1 192.168.109.1 56 64 0ms
2 192.168.109.1 56 64 0ms
3 192.168.109.1 56 64 0ms