Correctly show actions such as Connect/Disconnect on Status Interfaces page.

This commit is contained in:
Ermal Lui 2009-02-28 19:30:27 +00:00
parent a7db7d3ab8
commit 56e1d16eba
2 changed files with 7 additions and 6 deletions

View File

@ -3002,12 +3002,14 @@ function get_interface_info($ifdescr) {
unset($linkinfo);
exec("/usr/bin/netstat -I " . $ifinfo['if'] . " -nWb -f link", $linkinfo);
$linkinfo = preg_split("/\s+/", $linkinfo[1]);
if (preg_match("/\*$/", $linkinfo[0])) {
if (preg_match("/{$ifinfo['if']}\*/", $linkinfo[0])) {
$ifinfo['status'] = "down";
} else {
} else if (preg_match("/{$ifinfo['if']}/", $linkinfo[0])) {
$ifinfo['status'] = "up";
}
} else
$ifinfo['status'] = "down";
if (preg_match("/^enc|^tun|^ppp|^pptp|^ovpn/i", $ifinfo['if'])) {
$ifinfo['inpkts'] = $linkinfo[3];

View File

@ -48,10 +48,9 @@ if ($_GET['if']) {
interface_bring_down($interface);
} else if ($_GET['action'] == "Connect" || $_GET['action'] == "Renew") {
interface_configure($interface);
} else {
header("Location: status_interfaces.php");
exit;
}
header("Location: status_interfaces.php");
exit;
}
$pgtitle = array("Status","Interfaces");