diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-10 10:21:18 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-10 10:21:18 -0700 |
commit | b2fd1d96604d32bbe946f4df3118eb50454e6d26 (patch) | |
tree | 4de88daa9a4baefc864590971b18902e55ec0472 /scripts | |
parent | cecf4322ff05df1acfa1cf22cba593e13e797197 (diff) | |
parent | 96c622d04550ae38bd2d1ebc8d209a79e4017067 (diff) | |
download | vyatta-op-b2fd1d96604d32bbe946f4df3118eb50454e6d26.tar.gz vyatta-op-b2fd1d96604d32bbe946f4df3118eb50454e6d26.zip |
Merge branch 'jenner' of 192.168.100.1:git/vyatta-op into jenner
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-show-bonding.pl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/vyatta-show-bonding.pl b/scripts/vyatta-show-bonding.pl index 5b0a314..902be4e 100755 --- a/scripts/vyatta-show-bonding.pl +++ b/scripts/vyatta-show-bonding.pl @@ -81,6 +81,9 @@ sub show_brief { printf $format, 'Interface', 'Mode', 'State', 'Link', 'Slaves'; foreach my $intf (sort @interfaces) { + die "Invalid bonding interface: $intf\n" + unless (-d "/sys/class/net/$intf/bonding" ); + my $mode = get_sysfs_value( $intf, "bonding/mode" ); my ( $name, $num ) = split (/ /, $mode); $mode = $modes[$num] ? $modes[$num] : $name; @@ -98,6 +101,9 @@ sub show { printf $format, "Interface", "RX: bytes", "packets", "TX: bytes", "packets"; foreach my $intf (sort @interfaces) { + die "Invalid bonding interface: $intf\n" + unless (-d "/sys/class/net/$intf/bonding" ); + 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" ), |