From 946db1f1c6c664191b21f98a825c4a4f095bcb03 Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Wed, 4 May 2011 17:20:24 +0800 Subject: changes for new commit --- templates/protocols/node.def | 1 - templates/protocols/ospf/node.def | 15 +++++++++++++-- templates/protocols/ospf/parameters/node.def | 1 - templates/protocols/ospf/parameters/router-id/node.def | 6 ------ templates/protocols/ospfv3/node.def | 15 +++++++++++++-- templates/protocols/ospfv3/parameters/node.def | 1 - templates/protocols/ospfv3/parameters/router-id/node.def | 3 --- 7 files changed, 26 insertions(+), 16 deletions(-) diff --git a/templates/protocols/node.def b/templates/protocols/node.def index 601ea951..2f7eead5 100644 --- a/templates/protocols/node.def +++ b/templates/protocols/node.def @@ -1,2 +1 @@ -priority: 900 help: Routing protocol parameters 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 diff --git a/templates/protocols/ospf/parameters/node.def b/templates/protocols/ospf/parameters/node.def index 0864bb0b..c8d4482b 100644 --- a/templates/protocols/ospf/parameters/node.def +++ b/templates/protocols/ospf/parameters/node.def @@ -1,2 +1 @@ -priority: 610 help: OSPF specific parameters diff --git a/templates/protocols/ospf/parameters/router-id/node.def b/templates/protocols/ospf/parameters/router-id/node.def index e1b073fe..5f7966e6 100644 --- a/templates/protocols/ospf/parameters/router-id/node.def +++ b/templates/protocols/ospf/parameters/router-id/node.def @@ -1,8 +1,2 @@ type: ipv4 help: Override the default router identifier -update:expression: "vtysh -c \"configure terminal\" \ - -c \"router ospf\" \ - -c \"ospf router-id $VAR(@)\" " -delete:expression: "vtysh -c \"configure terminal\" \ - -c \"router ospf\" \ - -c \"no ospf router-id \" " diff --git a/templates/protocols/ospfv3/node.def b/templates/protocols/ospfv3/node.def index 72e1886f..56655199 100644 --- a/templates/protocols/ospfv3/node.def +++ b/templates/protocols/ospfv3/node.def @@ -1,4 +1,15 @@ priority: 640 help: IPv6 Open Shortest Path First protocol (OSPFv3) parameters -create: vtysh -c "configure terminal" -c "router ospf6" -delete: vtysh -c "configure terminal" -c "no router ospf6" +begin: if [ "$COMMIT_ACTION" != DELETE ]; then + if [ -n "$VAR(parameters/router-id/@)" ]; then + vtysh -c "configure terminal" -c "router ospf6" \ + -c "router-id $VAR(parameters/router-id/@)" + else + vtysh -c "configure terminal" -c "router ospf6" \ + -c "no router-id" + fi + fi +end: if [ "$COMMIT_ACTION" == DELETE ]; then + vtysh -c "configure terminal" -c "router ospf6" -c "no router-id" + vtysh -c "configure terminal" -c "no router ospf6" + fi diff --git a/templates/protocols/ospfv3/parameters/node.def b/templates/protocols/ospfv3/parameters/node.def index 8f16d09d..11fda8f8 100644 --- a/templates/protocols/ospfv3/parameters/node.def +++ b/templates/protocols/ospfv3/parameters/node.def @@ -1,2 +1 @@ -priority: 630 help: OSPFv3 specific parameters diff --git a/templates/protocols/ospfv3/parameters/router-id/node.def b/templates/protocols/ospfv3/parameters/router-id/node.def index f0a02436..659cccf1 100644 --- a/templates/protocols/ospfv3/parameters/router-id/node.def +++ b/templates/protocols/ospfv3/parameters/router-id/node.def @@ -1,5 +1,2 @@ type: ipv4 help: Router identifier -update:expression: "vtysh -c \"configure terminal\" \ - -c \"router ospf6\" \ - -c \"router-id $VAR(@)\" " -- cgit v1.2.3