Subversion Repositories ALCASAR

Compare Revisions

Ignore whitespace Rev 3108 → Rev 3127

/web/acc/welcome.php
22,11 → 22,8
}
// router test
function routerTest($host) {
$port = 80;
 
$test = exec("ping -c 3 $host", $out, $res);
 
return ($res == 0) ? true : false;
$out = exec("(sudo arping -c1 -f $host|grep 'Received 0 response'|wc -l)");
return ($out == "0") ? true : false;
}
 
// Internet test
50,8 → 47,8
return false;
}
 
// filtering test
function filtrageTest($file, $search_regex){
// searchString = search for a string in a file
function searchString($file, $search_regex){
$pointeur = fopen($file,"r");
$result = false;
if ($pointeur)
170,7 → 167,7
}
 
// Internet status
if ((filtrageTest("/var/www/html/index.php","/network_pb = false/")) && (internetTest())) {
if ((searchString("/var/www/html/index.php","/network_pb = false/")) && (internetTest())) {
$internet_status = $l_DNS." "." <img src='/images/state_ok.gif'> ";
$version = dns_get_record("version.alcasar.net",DNS_TXT);
if (!empty($version)) {