Witam, Chce stworzyc skrypt ktory laczy sie na adres IP z listy na port 22, czyta baner (zawierajacy slowo Cisco) i mowi czy to jest urzadzenie Cisco albo nie. Niestety nie potrafie tego ugryzc ponizszym skryptem. Ma ktos jakis pomysl ?
#!/bin/bash
port='22'
cat /opt/list | while read host
do nc -v $host $port & sleep 4 > /opt/output; kill $!;
if grep Cisco /opt/output;
then
echo "This is Cisco device" @ $(date +"%b %d %H:%M %Y") $host:$port [ OPEN ] | tee -a /opt/success_log.txt;
else
echo "This is not Cisco device" @ $(date +"%b %d %H:%M %Y") $host:$port [ CLOSED ] | tee -a /opt/failure_log.txt;
fi
done