1 | 1 | simandl | #!/bin/sh |
2 | | | |
3 | | | # (c)2003 by Jan Krupa (krupaj@mobilnews.cz) |
4 | | | # http://www.mobilnews.cz/honza/ |
5 | | | |
6 | | | NMAP_PATH=nmap |
7 | | | |
8 | | | ping_host_all=""; |
9 | | | |
10 | | | for LINE in `cat $1`; do |
11 | | | ping_host=`echo -n $LINE | awk -F\; '{ printf "%s", $2 }'`; |
12 | | | ping_host_all="${ping_host_all} ${ping_host}"; |
13 | | | done |
14 | | | |
15 | | | $NMAP_PATH -vnsP $ping_host_all | awk -F\ '{ if ($1=="Host") { if (match($2, /\(/) == 0) { printf "%s;", $2; } else { printf "%s;", substr($2, 2, (length($2)-2)); } if ($6=="up.") printf "1;0;\n"; else printf "0;0;\n"; } }'; |