Improved 'interface not configured' detection

This commit is contained in:
bergware
2016-06-05 17:08:40 +02:00
parent 92749903a1
commit f1cd69fb34
2 changed files with 12 additions and 2 deletions

View File

@@ -16,7 +16,7 @@ Png="ethernet.png"
?>
<?
// get interface configuration state
$down = strlen(exec("ip link show ethX|grep -om1 ',UP[,>]'"))==0;
$down = empty($ethX) || strlen(exec("ip link show ethX|grep -om1 ',UP[,>]'"))==0;
// get VLAN interfaces
$vlan_ethX = [0];

View File

@@ -11,5 +11,15 @@
*/
?>
<?
if ($_POST['#arg'][1] != 'none') unset($keys[$_POST['#section']]); // do nothing when only description has changed
if ($_POST['#arg'][1] != 'none') {
if ($_POST['BONDING']=='yes') {
$nics = explode(',',str_replace('eth0','',$_POST['BONDNICS']));
foreach ($nics as $nic) if ($nic) unset($keys[$nic]);
}
if ($_POST['BRIDGING']=='yes') {
$nics = explode(',',str_replace('eth0','',$_POST['BRNICS']));
foreach ($nics as $nic) if ($nic) unset($keys[$nic]);
}
unset($keys[$_POST['#section']]);
}
?>