cristi wrote:

>Domnul Dragos Moroianu (sa-i traiasca familia) a pus pe net urmatorul script
>de monitorizare a legaturii la internet:
>
>#!/bin/sh
>rez=$(ping -c 3 www.yahoo.com | grep "100\% packet loss");
>if [[ -z $rez ]]; then
>echo $(date) "Internet works"
>else
>echo $(date) "Internet doesn't work"
>fi
>
>Excelent scriptul si incelasi timp util dar in cazul in care legatura la
>internet nu exista acesta se blocheaza in loc sa afiseze mesajul: "Internet
>doesn't work"  .
>Poate cineva repara bug_ul?
>
>Multumiri anticipate!
>
>
>
>  
>
Incearca sa completezi la ping -c <numar> <site> cu -w <timp>

Din man ping:
       -w deadline
              Specify a timeout, in seconds, before ping exits  
regardless  of
              how  many  packets have been sent or received. In this 
case ping
              does not stop after count packet are sent, it waits  
either  for
              deadline  expire  or until count probes are answered or 
for some
              error notification from network.


-- 
Coica Laurentiu
CNL Oltenia Tg-Jiu
0740-040.328



Raspunde prin e-mail lui