mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
fix failed copy/paste lines
This commit is contained in:
parent
365bb3fa25
commit
dc790b246b
@ -5,7 +5,7 @@ define("ACCESS_CHECK_DNS","one.one.one.one");
|
|||||||
|
|
||||||
$rInfo=array();
|
$rInfo=array();
|
||||||
// get all default routes
|
// get all default routes
|
||||||
exec('ip route list | sed -rn "s/default via (([0-9]{1,3}\.){3}[0-9]{1,3}).*dev (\w*).*src (([0-9]{1,3}\.){$
|
exec('ip route list | sed -rn "s/default via (([0-9]{1,3}\.){3}[0-9]{1,3}).*dev (\w*).*src (([0-9]{1,3}\.){3}[0-9]{1,3}).*/\3 \4 \1/p"',$routes);
|
||||||
if ( !empty($routes) ) {
|
if ( !empty($routes) ) {
|
||||||
foreach ($routes as $i => $route) {
|
foreach ($routes as $i => $route) {
|
||||||
$prop=explode(' ',$route);
|
$prop=explode(' ',$route);
|
||||||
@ -18,16 +18,16 @@ define("ACCESS_CHECK_DNS","one.one.one.one");
|
|||||||
$rInfo[$i]["gw-name"] = $host[0];
|
$rInfo[$i]["gw-name"] = $host[0];
|
||||||
if (isset($checkAccess) && $checkAccess) {
|
if (isset($checkAccess) && $checkAccess) {
|
||||||
// check internet connectivity w/ and w/o DNS resolution
|
// check internet connectivity w/ and w/o DNS resolution
|
||||||
exec('ping -W1 -c 1 -I '.$prop[0].' '.ACCESS_CHECK_IP.' | sed -rn "s/.*icmp_seq=1.*time=.*/\&check\;$
|
exec('ping -W1 -c 1 -I '.$prop[0].' '.ACCESS_CHECK_IP.' | sed -rn "s/.*icmp_seq=1.*time=.*/\&check\;/p"',$okip);
|
||||||
if (empty($okip)) $okip[0]="failed";
|
if (empty($okip)) $okip[0]="failed";
|
||||||
$rInfo[$i]["access-ip"] = $okip[0];
|
$rInfo[$i]["access-ip"] = $okip[0];
|
||||||
exec('ping -W1 -c 1 -I '.$prop[0].' '.ACCESS_CHECK_DNS.' | sed -rn "s/.*icmp_seq=1.*time=.*/\&check\$
|
exec('ping -W1 -c 1 -I '.$prop[0].' '.ACCESS_CHECK_DNS.' | sed -rn "s/.*icmp_seq=1.*time=.*/\&check\;/p"',$okdns);
|
||||||
if (empty($okdns)) $okdns[0]="failed";
|
if (empty($okdns)) $okdns[0]="failed";
|
||||||
$rInfo[$i]["access-dns"] = $okdns[0];
|
$rInfo[$i]["access-dns"] = $okdns[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$data = array("error"=>"No route to the internet found");
|
$rInfo = array("error"=>"No route to the internet found");
|
||||||
}
|
}
|
||||||
$rInfo_json = json_encode($rInfo);
|
$rInfo_json = json_encode($rInfo);
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user