From 2481bbd99422e16c22e8c705d44e3dd66d17be13 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 25 Feb 2009 12:43:26 -0800 Subject: Handle mapping from ospfv3 to ospf6d This is the one place where mapping from protocols in config to daemon name needs to occur. --- scripts/vyatta-show-protocols | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'scripts') 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"; -- cgit v1.2.3