summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xetc/rc.initial.setlanip11
1 files changed, 10 insertions, 1 deletions
diff --git a/etc/rc.initial.setlanip b/etc/rc.initial.setlanip
index 330042d..a6b4215 100755
--- a/etc/rc.initial.setlanip
+++ b/etc/rc.initial.setlanip
@@ -77,13 +77,22 @@
$intnum = $j;
}
-
if($intnum < 1)
exit;
if($intnum > $j)
exit;
$interface = $ifdescrs[$intnum-1];
+ $interface = $ifdescrs[$intnum-1];
+ $index = 1;
+ foreach ($ifdescrs as $ifname => $ifdesc) {
+ if ($intnum == $index) {
+ $interface = $ifname;
+ break;
+ } else {
+ $index++;
+ }
+ }
if(!$interface) {
echo "Invalid interface!\n";
exit;
OpenPOWER on IntegriCloud