summaryrefslogtreecommitdiffstats
path: root/usr/local/www/interfaces_assign.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/interfaces_assign.php')
-rwxr-xr-xusr/local/www/interfaces_assign.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/usr/local/www/interfaces_assign.php b/usr/local/www/interfaces_assign.php
index 8a3b386..9667e75 100755
--- a/usr/local/www/interfaces_assign.php
+++ b/usr/local/www/interfaces_assign.php
@@ -126,6 +126,22 @@ if ($_GET['act'] == "del") {
unset($config['interfaces'][$id]); /* delete the specified OPTn */
+ /* shift down other OPTn interfaces to get rid of holes */
+ $i = substr($id, 3); /* the number of the OPTn port being deleted */
+ $i++;
+
+ /* look at the following OPTn ports */
+ while (is_array($config['interfaces']['opt' . $i])) {
+ $config['interfaces']['opt' . ($i - 1)] =
+ $config['interfaces']['opt' . $i];
+
+ if ($config['interfaces']['opt' . ($i - 1)]['descr'] == "OPT" . $i)
+ $config['interfaces']['opt' . ($i - 1)]['descr'] = "OPT" . ($i - 1);
+
+ unset($config['interfaces']['opt' . $i]);
+ $i++;
+ }
+
write_config();
/* move all the interfaces up. for example:
@@ -280,4 +296,4 @@ if(file_exists("/var/run/interface_mismatch_reboot_needed"))
exec("/etc/rc.reboot");
}
-?>
+?> \ No newline at end of file
OpenPOWER on IntegriCloud