summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRobert Bays <rbays@roatan.(none)>2010-05-22 23:21:48 -0700
committerRobert Bays <rbays@roatan.(none)>2010-05-22 23:21:48 -0700
commit674a60ba8dc885f0d1a7775fdfc000c653a76deb (patch)
tree810bdfda4a2caa5130c39daecbb603401b3a6dca /scripts
parentea03012e644d5d292857ec6b9dcaa4cdde1da4aa (diff)
downloadvyatta-cfg-quagga-674a60ba8dc885f0d1a7775fdfc000c653a76deb.tar.gz
vyatta-cfg-quagga-674a60ba8dc885f0d1a7775fdfc000c653a76deb.zip
add functionality to skip nodes while in _setConfigTree
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/bgp/vyatta-bgp.pl14
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/bgp/vyatta-bgp.pl b/scripts/bgp/vyatta-bgp.pl
index 12b1349f..b72deab9 100755
--- a/scripts/bgp/vyatta-bgp.pl
+++ b/scripts/bgp/vyatta-bgp.pl
@@ -148,7 +148,7 @@ my %qcom = (
del => undef,
},
"protocols bgp var neighbor var" => {
- set => "router bgp #3 ; neighbor #5",
+ set => undef,
del => "router bgp #3 ; no neighbor #5",
},
"protocols bgp var neighbor var address-family" => {
@@ -1213,8 +1213,18 @@ sub main {
#$qconfig->_reInitialize();
# deletes with priority
+ # TODO: need to put syntax check in remote-as
+ # delete everything in neighbhor except for the important nodes
+ my @skip_array = ('remote-as', 'route-map', 'filter-list', 'prefix-list', 'distribute-list', 'unsuppress-map');
+ # notice the extra space in the level string. keeps the parent from being deleted.
+ $qconfig->deleteConfigTreeRecursive('protocols bgp var neighbor var ', @skip_array) || die "exiting $?\n";
+ # now delete everything in neighbor except remote-as
+ @skip_array = ('remote-as');
+ $qconfig->deleteConfigTreeRecursive('protocols bgp var neighbor var ', @skip_array) || die "exiting $?\n";
+ # now finish off neighbor
+ $qconfig->deleteConfigTreeRecursive('protocols bgp var neighbor var') || die "exiting $?\n";
+ # now delete everything else
$qconfig->deleteConfigTreeRecursive('protocols bgp') || die "exiting $?\n";
- # would be cool if I could add a recursive delete such as everything but (protocols bgp var neigh var remote-as)
# sets with priority
$qconfig->setConfigTreeRecursive('protocols bgp var parameters') || die "exiting $?\n";