summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-26 14:32:09 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-10-26 14:32:09 -0700
commit531f96177092d44d3dc6ad8597ae353d4cf989ca (patch)
tree7e33f56087a9e459eb8ca45c22416577aab6f317
parent4a92157b9e077514fdbf5845169323ed7370bedb (diff)
downloadvyatta-cfg-system-531f96177092d44d3dc6ad8597ae353d4cf989ca.tar.gz
vyatta-cfg-system-531f96177092d44d3dc6ad8597ae353d4cf989ca.zip
Sort the interface names when adding
Makes new entries show up in order.
-rwxr-xr-xscripts/system/vyatta_interface_rescan5
1 files changed, 4 insertions, 1 deletions
diff --git a/scripts/system/vyatta_interface_rescan b/scripts/system/vyatta_interface_rescan
index 62d550bf..2803099b 100755
--- a/scripts/system/vyatta_interface_rescan
+++ b/scripts/system/vyatta_interface_rescan
@@ -89,10 +89,13 @@ sub interface_rescan {
my $xcp = new XorpConfigParser();
$xcp->parse($BOOTFILE);
+ # get list of changed interfaces
opendir( my $dir, $VYATTAUDEV )
or die "Can't open $VYATTAUDEV : $!";
+ my @interfaces = grep { ! /^\./ } readdir($dir);
+ close $dir;
- foreach my $ifname (grep { ! /^\./ } readdir($dir)) {
+ foreach my $ifname (sort @interfaces) {
my $ifpath = interface_type($ifname) . " $ifname";
if ($xcp->get_node(['interfaces', $ifpath])) {
syslog(LOG_INFO, "%s: is already in config file", $ifname);