1 | 1 | simandl | #!/bin/sh |
2 | | | |
3 | | | # (c)2003 by Jan Krupa (krupaj@mobilnews.cz) |
4 | | | # http://www.mobilnews.cz/honza/ |
5 | | | |
6 | | | PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/usr/bin/X11:/usr/X11R6/bin:/root/bin |
7 | | | export PATH |
8 | | | |
9 | | | |
10 | | | FPING_PATH=/usr/sbin/fping |
11 | | | |
12 | | | ping_host_all=""; |
13 | | | |
14 | | | for LINE in `/bin/cat $1`; do |
15 | | | ping_host=`/bin/echo -n $LINE | /bin/awk -F\; '{ printf "%s", $2 }'`; |
16 | | | ping_host_all="${ping_host_all} ${ping_host}"; |
17 | | | done |
18 | | | |
19 | | | $FPING_PATH -e $ping_host_all | /bin/awk -F\ '{ printf "%s;", $1; if ($3=="alive") printf "1;%s;\n", substr($4, 2, (length($4)-1)); else printf "0;0;\n"; }'; |