# if e controllo exit code comando ping if ping -c 5 www.google.it ; then status1=0 #(ok) echo "OK - www.google.it" else status2=1 #(error) echo "ERROR - www.google.it" fi #if con operatore logico AND if (( ($status1 == 1) && ($status2 == 1) && ($status3 == 1 ) )); then echo "Gatweway ERROR ( Code $status1 $status2 $status3 )" else echo "Gateway OK ( Code $status1 $status2 $status3 )" fi