diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-show-bonding.pl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/vyatta-show-bonding.pl b/scripts/vyatta-show-bonding.pl index 902be4e..62d503e 100755 --- a/scripts/vyatta-show-bonding.pl +++ b/scripts/vyatta-show-bonding.pl @@ -104,13 +104,15 @@ sub show { die "Invalid bonding interface: $intf\n" unless (-d "/sys/class/net/$intf/bonding" ); - my @slaves = split( / /, get_sysfs_value( $intf, "bonding/slaves" ) ); + my $slaves = get_sysfs_value( $intf, "bonding/slaves" ); + next unless $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 (sort @slaves) { + foreach my $slave (sort split( / /, $slaves)) { printf $format, ' ' . $slave, get_sysfs_value( $slave, "statistics/rx_bytes" ), get_sysfs_value( $slave, "statistics/rx_packets" ), |