summaryrefslogtreecommitdiff
path: root/scripts/vyatta-interfaces.pl
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-02 09:53:20 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2010-04-02 09:53:20 -0700
commitefe4b345fa2fdf33b4e3f2946b0d835ef3f1fcef (patch)
tree74511d04cfc607e4780e6ab727269d6dc21fdea2 /scripts/vyatta-interfaces.pl
parentc5c081bb058bf399fab9b16dccb3111968617b6a (diff)
downloadvyatta-cfg-quagga-efe4b345fa2fdf33b4e3f2946b0d835ef3f1fcef.tar.gz
vyatta-cfg-quagga-efe4b345fa2fdf33b4e3f2946b0d835ef3f1fcef.zip
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.
Diffstat (limited to 'scripts/vyatta-interfaces.pl')
-rwxr-xr-xscripts/vyatta-interfaces.pl2
1 files changed, 2 insertions, 0 deletions
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";
}