summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-27 09:58:21 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-04-27 09:58:21 -0700
commitb5f24bc299200fcaf48dcb4a5a499ebed2548f97 (patch)
tree78bc34e0bd148b1424eaf2c5a4808caf81f3a5a7 /scripts
parent2f753503721cfb723a90d98e0ebb1089e5448532 (diff)
downloadvyatta-cfg-b5f24bc299200fcaf48dcb4a5a499ebed2548f97.tar.gz
vyatta-cfg-b5f24bc299200fcaf48dcb4a5a499ebed2548f97.zip
Handle errors better in show_mtu
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-interfaces.pl6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl
index de5fa49..45d18d8 100755
--- a/scripts/vyatta-interfaces.pl
+++ b/scripts/vyatta-interfaces.pl
@@ -157,7 +157,11 @@ sub get_mtu {
sub show_mtu {
my $name = shift;
- my $mtu = get_mtu($name);
+ my $intf = new Vyatta::Interface($name);
+ die "$name does not match any known interface name type\n"
+ unless $intf;
+
+ my $mtu = $intf->mtu();
print "$mtu\n" if $mtu;
}