From efe4b345fa2fdf33b4e3f2946b0d835ef3f1fcef Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Fri, 2 Apr 2010 09:53:20 -0700 Subject: Fail gracefully if path is unknown If device is ppp but not in Vyatta config, the configuration path will be undefined. So have script give reasonable error rather than perl undefined variable message. --- scripts/vyatta-interfaces.pl | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts') diff --git a/scripts/vyatta-interfaces.pl b/scripts/vyatta-interfaces.pl index cbb6abf6..5b7f2cee 100755 --- a/scripts/vyatta-interfaces.pl +++ b/scripts/vyatta-interfaces.pl @@ -537,6 +537,8 @@ sub show_config_path { die "$name does not match any known interface name type\n" unless $intf; my $level = $intf->path(); + die "$name does not have a known path\n" unless $level; + $level =~ s/ /\//g; print "/opt/vyatta/config/active/$level\n"; } -- cgit v1.2.3