summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-25 12:43:26 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-02-25 12:43:26 -0800
commit2481bbd99422e16c22e8c705d44e3dd66d17be13 (patch)
tree78591493c9c107363e175d1e4cf5eb81c3735656
parent0e1f4ee36324e32744114a8bdaad796b9938675c (diff)
downloadvyatta-cfg-quagga-2481bbd99422e16c22e8c705d44e3dd66d17be13.tar.gz
vyatta-cfg-quagga-2481bbd99422e16c22e8c705d44e3dd66d17be13.zip
Handle mapping from ospfv3 to ospf6d
This is the one place where mapping from protocols in config to daemon name needs to occur.
-rwxr-xr-xscripts/vyatta-show-protocols16
1 files changed, 11 insertions, 5 deletions
diff --git a/scripts/vyatta-show-protocols b/scripts/vyatta-show-protocols
index c81dcb82..4f3e0a92 100755
--- a/scripts/vyatta-show-protocols
+++ b/scripts/vyatta-show-protocols
@@ -31,7 +31,14 @@ my %actions = (
'deleted' => 'isDeleted',
);
-my @protocols = qw(bgp isis ospf ospf6 rip ripng);
+my %daemons = (
+ 'bgp' => 'bgpd',
+ 'ospf' => 'ospfd',
+ 'ospfv3' => 'ospf6d',
+ 'rip' => 'ripd',
+ 'ripng' => 'ripngd',
+ 'isis' => 'isisd',
+);
sub usage {
die "Usage: $0 {",join('|',keys %actions),"}\n"
@@ -44,8 +51,7 @@ usage unless $match;
my $config = new Vyatta::Config;
$config->setLevel('protocols');
-# Avoid the urge to do Perl Golf here...
-my @found = grep { $config->$match($_) } @protocols;
-my @daemons = map { $_ . 'd' } @found;
-print join(' ', @daemons), "\n";
+# Should have avoided the urge to do Perl golf here...
+my @found = grep { $config->$match($_) } keys %daemons;
+print join(' ', map { $daemons{$_} } @found),"\n";