Commit e9866f95 authored by Franco Fichtner's avatar Franco Fichtner

config: adhere to defaults, but force a mismatch on factory bootup; #5

parent 33fec4ae
......@@ -210,7 +210,7 @@
<interfaces>
<wan>
<enable/>
<if>em1</if>
<if>mismatch1</if>
<mtu></mtu>
<ipaddr>dhcp</ipaddr>
<ipaddrv6>dhcp6</ipaddrv6>
......@@ -232,7 +232,7 @@
</wan>
<lan>
<enable/>
<if>em0</if>
<if>mismatch0</if>
<ipaddr>192.168.1.1</ipaddr>
<subnet>24</subnet>
<ipaddrv6>track6</ipaddrv6>
......
......@@ -109,7 +109,8 @@ EOD;
if ($interactive) {
$wanif = chop(fgets($fp));
} else {
$wanif = $ifnames[0];
/* more than one interface: put WAN as second one */
$wanif = count($ifnames) > 1 ? $ifnames[1] : '';
echo $wanif . PHP_EOL;
}
......@@ -135,7 +136,8 @@ EOD;
if ($interactive) {
$lanif = chop(fgets($fp));
} else {
$lanif = '';
/* at least one interface: put LAN as first one */
$lanif = count($ifnames) > 0 ? $ifnames[0] : '';
echo $lanif . PHP_EOL;
}
......@@ -181,7 +183,13 @@ EOD;
printf(gettext("%sEnter the Optional %s interface name or 'a' for auto-detection%s" .
"(or nothing if finished):%s"), "\n", $io, "\n", " ");
$optif[$i] = chop(fgets($fp));
if ($interactive) {
$optif[$i] = chop(fgets($fp));
} else {
/* never configure OPT in automatic assign */
$optif[$i] = '';
echo $optif[$i] . PHP_EOL;
}
if ($optif[$i] == '') {
unset($optif[$i]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment