summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-10 17:10:08 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-11-10 17:10:08 -0800
commit6b506130775b71f50a8ec8b8b635e224cb93125f (patch)
tree4c55472007702771adab5febb8a3bc09341a7da0 /scripts
parent25fcf6dc13e367b63f958a64f4d91c5816cbfd7a (diff)
downloadvyatta-op-6b506130775b71f50a8ec8b8b635e224cb93125f.tar.gz
vyatta-op-6b506130775b71f50a8ec8b8b635e224cb93125f.zip
Sort interfaces in bonding operational mode commands
For consistency with show interfaces, sort output by device name
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-show-bonding.pl6
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/vyatta-show-bonding.pl b/scripts/vyatta-show-bonding.pl
index 2b7c8d6..8a0daee 100755
--- a/scripts/vyatta-show-bonding.pl
+++ b/scripts/vyatta-show-bonding.pl
@@ -71,7 +71,7 @@ sub show_brief {
my $format = "%-12s %-10s %-8s %-6s %s\n";
printf $format, 'Interface', 'Mode', 'State', 'Link', 'Slaves';
- foreach my $intf (@interfaces) {
+ foreach my $intf (sort @interfaces) {
my $mode = get_sysfs_value( $intf, "bonding/mode" );
$mode =~ s/ [0-9]+$//;
my ( $state, $link ) = get_state_link($intf);
@@ -86,14 +86,14 @@ sub show {
my $format = "%-16s %-10s %-10s %-10s %-10s\n";
printf $format, "Interface", "RX: bytes", "packets", "TX: bytes", "packets";
- foreach my $intf (@interfaces) {
+ foreach my $intf (sort @interfaces) {
my @slaves = split( / /, get_sysfs_value( $intf, "bonding/slaves" ) );
printf $format, $intf, get_sysfs_value( $intf, "statistics/rx_bytes" ),
get_sysfs_value( $intf, "statistics/rx_packets" ),
get_sysfs_value( $intf, "statistics/tx_bytes" ),
get_sysfs_value( $intf, "statistics/tx_packets" );
- foreach my $slave (@slaves) {
+ foreach my $slave (sort @slaves) {
printf $format, ' ' . $slave,
get_sysfs_value( $slave, "statistics/rx_bytes" ),
get_sysfs_value( $slave, "statistics/rx_packets" ),