=4.2) { $PING="ping -c 1 -w 1 $PING_INTERNET | awk '/packet/ {print $6}'"; } else { $PING="ping -c 1 $PING_INTERNET | awk '/packet/ {print $7}'"; } */ // Ping passerelle //$PING_ROUTEUR=`cat /etc/network/interfaces | grep gateway | grep -v broadcast | cut -d" " -f 2`; //$PING_ROUTEUR=trim($PING_ROUTEUR); $PING_DNS_EXT = "193.49.64.5"; if ($phpv>=4.2) { $PING="ping -c 1 -w 1 $PING_DNS_EXT | awk '/packet/ {print $6}'"; } else { $PING="ping -c 1 $PING_DNS_EXT | awk '/packet/ {print $7}'"; } $ligne=exec("$PING",$test,$testretour); //$ok="0"; /* if (($_POST['ligne_internet'] == "0%") && ($ligne == "0%")) { $ok="1"; } elseif (($_POST['ligne_internet'] != "0%") && ($ligne != "0%")) { $ok="1"; } elseif (($_POST['ligne_internet'] != "0%") && ($ligne == "0%")) { $ok="1"; } elseif (($_POST['ligne_internet'] == "0%") && ($ligne != "0%")) { $ok="0"; } */ if ($ligne == "0%") echo "1"; else echo "0"; ?>