summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--etc/inc/system.inc23
-rwxr-xr-xusr/local/www/system.php37
2 files changed, 21 insertions, 39 deletions
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index e231fd1..64e4a60 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -140,18 +140,17 @@ function system_resolvconf_generate($dynupdate = false) {
services_dhcpd_configure();
}
- /* setup static routes for dns servers */
- if($config['system']['dns1gwint']) {
- $if = $config['system']['dns1gwint'];
- $gw = $config['interfaces'][$if]['if'];
- exec("route delete {$syscfg['dnsserver'][0]}");
- exec("route add {$syscfg['dnsserver'][0]} -gw {$gw}");
- }
- if($config['system']['dns2gwint']) {
- $if = $config['system']['dns2gwint'];
- $gw = $config['interfaces'][$if]['if'];
- exec("route delete {$syscfg['dnsserver'][1]}");
- exec("route add {$syscfg['dnsserver'][1]} -gw {$gw}");
+ for($dnscounter=1; $dnscounter<5; $dnscounter++) {
+ /* setup static routes for dns servers */
+ if($config['system']['dns{$dnscounter}gwint']) {
+ $if = $config['system']['dns{$dnscounter}gwint'];
+ if($if) {
+ $gw = $config['interfaces'][$if]['if'];
+ $dnscountermo = $dnscounter - 1;
+ exec("route delete {$syscfg['dnsserver'][$dnscountermo]}");
+ exec("route add {$syscfg['dnsserver'][$dnscountermo]} -gw {$gw}");
+ }
+ }
}
return 0;
diff --git a/usr/local/www/system.php b/usr/local/www/system.php
index 04885d6..3744d85 100755
--- a/usr/local/www/system.php
+++ b/usr/local/www/system.php
@@ -226,54 +226,37 @@ include("head.inc");
<?php
$multiwan = false;
foreach($config['interfaces'] as $int)
- if($int['gateway'])
+ if($int['gateway'])
$multiwan = true;
$ints = get_interface_list();
if($multiwan)
echo "<td><b>Use gateway</td>";
?>
</tr>
+<?php for($dnscounter=1; $dnscounter<5; $dnscounter++): ?>
<tr>
- <td>
- <input name="dns1" type="text" class="formfld unknown" id="dns1" size="20" value="<?=htmlspecialchars($pconfig['dns1']);?>">
+ <td>
+ <input name="dns{$dnscounter}" type="text" class="formfld unknown" id="dns{$dnscounter}" size="20" value="<?=htmlspecialchars($pconfig['dns{$dnscounter}']);?>">
</td>
<?php
- $ints = get_interface_list();
if($multiwan) {
- echo "<td><select name='dns1gwint'>\n";
- echo "<option></option>";
+ echo "<td><select name='dns{$dnscounter}gwint'>\n";
+ echo "<option value=''>wan</option>";
foreach($ints as $int) {
$friendly = $int['friendly'];
- if($config['interfaces'][$friendly]['gateway']) {
+ if($config['interfaces'][$friendly]['gateway']) {
$selected = "";
- if($pconfig['dns1gwint'] == $int)
+ if($pconfig['dns{$dnscounter}gwint'] == $int)
$selected = " SELECTED";
echo "<option value='{$friendly}'{$selected}>{$friendly}</option>";
}
}
echo "</select>";
}
- ?></td></tr>
- <tr><td>
- <input name="dns2" type="text" class="formfld unknown" id="dns22" size="20" value="<?=htmlspecialchars($pconfig['dns2']);?>">
- </td>
- <?php
- if($multiwan) {
- echo "<td><select name='dns2gwint'>\n";
- echo "<option></option>";
- foreach($ints as $int) {
- $friendly = $int['friendly'];
- if($config['interfaces'][$friendly]['gateway']) {
- $selected = "";
- if($pconfig['dns2gwint'] == $int)
- $selected = " SELECTED";
- echo "<option value='{$friendly}'{$selected}>{$friendly}</option>";
- }
- }
- echo "</select></td>";
- }
?>
+ </td>
</tr>
+<?php endfor; ?>
</table>
<br>
<span class="vexpl">IP addresses; these are also used for
OpenPOWER on IntegriCloud