w0nz3r
05-09-2013, 12:13
Ciao a tutti!
Stavo scrivendo uno script che mi risolve un host e mi verifica nel file "lista" se è presente l'indirizzo IP
Al momento sono arrivato a questo punto:
#!/bin/bash
IP=`host pippo.com | grep address | awk '{print $4}'`
while read LIST_IP;
do
if [ "${IP}" != "${LIST_IP}" ]; then
echo "IP ADDRESS NON PRESENTE NELLA LISTA"
else
echo "IP ADDRESS PRESENTE NELLA LISTA"
fi
done < lista | grep -v "#"
Il problema è che io vorrei che se anche un solo IP presente nel file "lista" è presente, non deve restituirmi errore.
Mi sapreste dare la solita dritta?
Grazie come sempre!
-w-
Stavo scrivendo uno script che mi risolve un host e mi verifica nel file "lista" se è presente l'indirizzo IP
Al momento sono arrivato a questo punto:
#!/bin/bash
IP=`host pippo.com | grep address | awk '{print $4}'`
while read LIST_IP;
do
if [ "${IP}" != "${LIST_IP}" ]; then
echo "IP ADDRESS NON PRESENTE NELLA LISTA"
else
echo "IP ADDRESS PRESENTE NELLA LISTA"
fi
done < lista | grep -v "#"
Il problema è che io vorrei che se anche un solo IP presente nel file "lista" è presente, non deve restituirmi errore.
Mi sapreste dare la solita dritta?
Grazie come sempre!
-w-