diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-04-27 09:58:21 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-04-27 09:58:21 -0700 |
commit | b5f24bc299200fcaf48dcb4a5a499ebed2548f97 (patch) | |
tree | 78bc34e0bd148b1424eaf2c5a4808caf81f3a5a7 | |
parent | 2f753503721cfb723a90d98e0ebb1089e5448532 (diff) | |
download | vyatta-cfg-b5f24bc299200fcaf48dcb4a5a499ebed2548f97.tar.gz vyatta-cfg-b5f24bc299200fcaf48dcb4a5a499ebed2548f97.zip |
Handle errors better in show_mtu
-rwxr-xr-x | scripts/vyatta-interfaces.pl | 6 |
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; } |