mirror of
https://github.com/RaspAP/raspap-webgui.git
synced 2024-11-26 01:20:27 +00:00
Merge pull request #663 from zbchristian/master
Update to list of default routes
This commit is contained in:
commit
9b17d9a093
1 changed files with 5 additions and 0 deletions
|
@ -3,6 +3,11 @@
|
|||
$rInfo=array();
|
||||
// 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}\.){3}[0-9]{1,3}).*/\3 \4 \1/p"', $routes);
|
||||
exec('ip route list | sed -rn "s/default dev (\w*) scope link/\1/p"',$devs);
|
||||
if(!empty($devs)) {
|
||||
foreach ($devs as $dev)
|
||||
exec('ip route list | sed -rn "s/(([0-9]{1,3}\.){3}[0-9]{1,3}).*dev.*("'.$dev.'").*scope link src (([0-9]{1,3}\.){3}[0-9]{1,3}).*/\3 \4 \1/p"',$routes);
|
||||
}
|
||||
if (!empty($routes) ) {
|
||||
foreach ($routes as $i => $route) {
|
||||
$prop=explode(' ', $route);
|
||||
|
|
Loading…
Reference in a new issue