From 5318fb1b6189e564dd533ffc4857c8743b19deee Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Fri, 16 Nov 2007 15:57:05 -0800 Subject: Fix "set policy route-map set aggregator". --- .../node.tag/rule/node.tag/set/aggregator/node.def | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'templates') diff --git a/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def b/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def index e32c3214..ac9eac8f 100644 --- a/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def +++ b/templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def @@ -1,21 +1,16 @@ help: "BGP aggregator attribute" +commit: $(./as/) != "" && $(./ip/) != ""; "Must configure both as and ip" +commit: $(../../action/) != ""; "Must configure an action" delete: "echo $(./as/@) $(./ip/@) > /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID" -end: "if [ -z \"$(./as/)\" ] || [ -z \"$(./ip/)\" ]; then \ - echo You must configure as and ip ; \ - exit 1 ; \ - fi ; \ - if [ -f \"/tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID\" ]; then \ +end: "if [ -f \"/tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID\" ]; then \ as=\\$(cat /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID); \ - else \ - as=\"$(./as/@) $(./ip/@)\"; \ - fi ; \ - /usr/bin/vtysh -c \"configure terminal\" \ + /usr/bin/vtysh -c \"configure terminal\" \ -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ -c \"no set aggregator as \\$as\" ; \ - if [ -f \"/tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID\" ]; then \ rm -rf /tmp/policy-route-map-$(../../../@)-$(../../action/@)-$(../../@)-set-aggregator.\\$PPID; \ else \ + as=\"$(./as/@) $(./ip/@)\"; \ /usr/bin/vtysh -c \"configure terminal\" \ - -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ - -c \"set aggregator as \\$as\" ; \ - fi; " + -c \"route-map $(../../../@) $(../../action/@) $(../../@)\" \ + -c \"set aggregator as \\$as\" ; \ + fi ; " -- cgit v1.2.3