summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-06-10 10:21:18 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-06-10 10:21:18 -0700
commitb2fd1d96604d32bbe946f4df3118eb50454e6d26 (patch)
tree4de88daa9a4baefc864590971b18902e55ec0472 /scripts
parentcecf4322ff05df1acfa1cf22cba593e13e797197 (diff)
parent96c622d04550ae38bd2d1ebc8d209a79e4017067 (diff)
downloadvyatta-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-xscripts/vyatta-show-bonding.pl6
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" ),