cand faci genul asta de scripturi, foloseste intotdeauna IP-uri, pt a fi cat mai putine point of failures (dns-ul de exemplu) si pentru a avea mesajele de eroare cat mai constante. anyway,
rez=$(ping -w2 -c 3 216.109.125.79 | grep "100%"); [ -z $rez ] && echo " $(date) okay" || echo "$(date) shit happened" ----- Original Message ----- From: "cristi" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, June 12, 2003 9:24 AM Subject: [rlug] Monitor Internet Linux > 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! > > > >
