summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/system.inc5
-rwxr-xr-xusr/local/www/system_routes.php17
-rwxr-xr-xusr/local/www/system_routes_edit.php13
3 files changed, 32 insertions, 3 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index ef14c9c..f01d674 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -440,6 +440,11 @@ function system_routing_configure($interface = "") {
if (!empty($interface) && $interface != $gateway['friendlyiface'])
continue;
+ if(isset($rtent['disabled'])) {
+ mwexec("/sbin/route delete " . escapeshellarg($rtent['network']), true);
+ continue;
+ }
+
$gatewayip = $gateway['gateway'];
$interfacegw = $gateway['interface'];
diff --git a/usr/local/www/system_routes.php b/usr/local/www/system_routes.php
index 64484a7..e4a36fb 100755
--- a/usr/local/www/system_routes.php
+++ b/usr/local/www/system_routes.php
@@ -60,7 +60,7 @@ if ($_POST) {
$retval = 0;
if (file_exists("{$g['tmp_path']}/.system_routes.apply")) {
- $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.system_routes.apply"));
+ $toapplylist = unserialize(file_get_contents("{$g['tmp_path']}/.system_routes.apply"));
foreach ($toapplylist as $toapply)
mwexec("{$toapply}");
@@ -138,21 +138,32 @@ include("head.inc");
</tr>
<tr>
<?php $i = 0; foreach ($a_routes as $route): ?>
+ <?php
+ if (isset($route['disabled'])) {
+ $textss = "<span class=\"gray\">";
+ $textse = "</span>";
+ } else
+ $textss = $textse = "";
+ ?>
<td class="listlr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
- <?=strtolower($route['network']);?>
+ <?=$textss;?><?=strtolower($route['network']);?><?=$textse;?>
</td>
<td class="listr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
+ <?=$textss;?>
<?php
echo htmlentities($a_gateways[$route['gateway']]['name']) . " - " . htmlentities($a_gateways[$route['gateway']]['gateway']);
?>
+ <?=$textse;?>
</td>
<td class="listr" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
+ <?=$textss;?>
<?php
echo convert_friendly_interface_to_friendly_descr($a_gateways[$route['gateway']]['friendlyiface']) . " ";
?>
+ <?=$textse;?>
</td>
<td class="listbg" ondblclick="document.location='system_routes_edit.php?id=<?=$i;?>';">
- <?=htmlspecialchars($route['descr']);?>&nbsp;
+ <?=$textss;?><?=htmlspecialchars($route['descr']);?>&nbsp;<?=$textse;?>
</td>
<td valign="middle" nowrap class="list">
<table border="0" cellspacing="0" cellpadding="1">
diff --git a/usr/local/www/system_routes_edit.php b/usr/local/www/system_routes_edit.php
index cf38206..3bce554 100755
--- a/usr/local/www/system_routes_edit.php
+++ b/usr/local/www/system_routes_edit.php
@@ -73,6 +73,7 @@ if (isset($id) && $a_routes[$id]) {
explode('/', $a_routes[$id]['network']);
$pconfig['gateway'] = $a_routes[$id]['gateway'];
$pconfig['descr'] = $a_routes[$id]['descr'];
+ $pconfig['disabled'] = isset($a_routes[$id]['disabled']);
}
if (isset($_GET['dup']))
@@ -130,6 +131,10 @@ if ($_POST) {
$route['network'] = $osn;
$route['gateway'] = $_POST['gateway'];
$route['descr'] = $_POST['descr'];
+ if ($_POST['disabled'])
+ $route['disabled'] = true;
+ else
+ unset($route['disabled']);
if (!isset($id))
$id = count($a_routes);
@@ -264,6 +269,14 @@ include("head.inc");
</div>
</tr>
<tr>
+ <td width="22%" valign="top" class="vncell"><?=gettext("Disabled");?></td>
+ <td width="78%" class="vtable">
+ <input name="disabled" type="checkbox" id="disabled" value="yes" <?php if ($pconfig['disabled']) echo "checked"; ?>>
+ <strong><?=gettext("Disable this static route");?></strong><br />
+ <span class="vexpl"><?=gettext("Set this option to disable this static route without removing it from the list.");?></span>
+ </td>
+ </tr>
+ <tr>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable">
<input name="descr" type="text" class="formfld unknown" id="descr" size="40" value="<?=htmlspecialchars($pconfig['descr']);?>">
OpenPOWER on IntegriCloud