summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--templates/policy/route-map/node.tag/rule/node.tag/set/aggregator/node.def21
1 files changed, 8 insertions, 13 deletions
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 ; "