diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-26 14:32:09 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2010-10-26 14:32:09 -0700 |
commit | 531f96177092d44d3dc6ad8597ae353d4cf989ca (patch) | |
tree | 7e33f56087a9e459eb8ca45c22416577aab6f317 | |
parent | 4a92157b9e077514fdbf5845169323ed7370bedb (diff) | |
download | vyatta-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-x | scripts/system/vyatta_interface_rescan | 5 |
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); |