summaryrefslogtreecommitdiff
path: root/templates/protocols/ospf/node.def
diff options
context:
space:
mode:
Diffstat (limited to 'templates/protocols/ospf/node.def')
-rw-r--r--templates/protocols/ospf/node.def15
1 files changed, 13 insertions, 2 deletions
diff --git a/templates/protocols/ospf/node.def b/templates/protocols/ospf/node.def
index cf71ff05..be8a8111 100644
--- a/templates/protocols/ospf/node.def
+++ b/templates/protocols/ospf/node.def
@@ -1,4 +1,15 @@
priority: 620
help: Open Shortest Path First protocol (OSPF) parameters
-create: vtysh -c "configure terminal" -c "router ospf"
-delete: vtysh -c "configure terminal" -c "no router ospf"
+begin: if [ "$COMMIT_ACTION" != DELETE ]; then
+ if [ -n "$VAR(parameters/router-id/@)" ]; then
+ vtysh -c "configure terminal" -c "router ospf" \
+ -c "ospf router-id $VAR(parameters/router-id/@)"
+ else
+ vtysh -c "configure terminal" -c "router ospf" \
+ -c "no ospf router-id"
+ fi
+ fi
+end: if [ "$COMMIT_ACTION" == DELETE ]; then
+ vtysh -c "configure terminal" -c "router ospf" -c "no ospf router-id"
+ vtysh -c "configure terminal" -c "no router ospf"
+ fi