分类:
2007-09-27 13:42:20
#!/sbin/sh logfile=/etc/chk/log/`date +%Y%m%d`.ping.log if [ -f "$logfile" ]; then rm $logfile fi touch $logfile tail -f $logfile & for i in `cat /etc/chk/hosts.ping.lst` do echo $i>>$logfile ping $i 1024 -n 3 | egrep -e "loss|avg" >>$logfile done kill `ps -f -u root | grep "tail -f $logfile" | awk '{print $2}'` >/dev/null exit |