diff options
author | Stig Thormodsrud <stig@io.vyatta.com> | 2009-02-25 14:28:51 -0800 |
---|---|---|
committer | Stig Thormodsrud <stig@io.vyatta.com> | 2009-02-25 14:28:51 -0800 |
commit | 068853566c433d230b731c53a2363d569096f4b7 (patch) | |
tree | 93d3bbfd5285f99fee3090733a2a4dc828fc1f35 /scripts/vyatta-show-protocols | |
parent | 505178511ac1d12e1aab6c08d6a02e983bbb0535 (diff) | |
parent | 6b57dcc5d252cc91505dab1fdd35b35ad4da4150 (diff) | |
download | vyatta-cfg-quagga-068853566c433d230b731c53a2363d569096f4b7.tar.gz vyatta-cfg-quagga-068853566c433d230b731c53a2363d569096f4b7.zip |
Merge branch 'jenner' of http://git.vyatta.com/vyatta-cfg-quagga into jenner
Diffstat (limited to 'scripts/vyatta-show-protocols')
-rwxr-xr-x | scripts/vyatta-show-protocols | 16 |
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"; |