summaryrefslogtreecommitdiff
path: root/templates/protocols
diff options
context:
space:
mode:
Diffstat (limited to 'templates/protocols')
-rw-r--r--templates/protocols/bgp/node.def15
-rw-r--r--templates/protocols/ospf/node.def8
-rw-r--r--templates/protocols/rip/node.def7
-rw-r--r--templates/protocols/ripng/node.def10
4 files changed, 23 insertions, 17 deletions
diff --git a/templates/protocols/bgp/node.def b/templates/protocols/bgp/node.def
index 69c2daab..ef80d812 100644
--- a/templates/protocols/bgp/node.def
+++ b/templates/protocols/bgp/node.def
@@ -2,9 +2,14 @@ tag:
type: u32
help: Configure Border Gateway Protocol (BGP) parameters
comp_help: \1 <1-4294967294>\tAS number
-syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294; "AS number must be between 1 and 4294967294"
-update: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)"
-# we need to set default parameters in BGP here since we can't do it in
-# startup scripts as we don't know the AS number at that point
-update: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)" -c "bgp network import-check"
+syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294 ; \
+ "AS number must be between 1 and 4294967294"
+
+create: if [ $(pgrep -c -x vyatta-bgpd) -eq 0 ]
+ then /opt/vyatta/sbin/vyatta-protocol start bgp
+ fi
+ vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)"
+update: vyatta-vtysh -c "configure terminal" -c "router bgp $VAR(@)" \
+ -c "bgp network import-check"
delete: vyatta-vtysh -c "configure terminal" -c "no router bgp $VAR(@)"
+
diff --git a/templates/protocols/ospf/node.def b/templates/protocols/ospf/node.def
index 7870a8cb..25ef78e3 100644
--- a/templates/protocols/ospf/node.def
+++ b/templates/protocols/ospf/node.def
@@ -1,5 +1,5 @@
help: Configure Open Shortest Path First protocol (OSPF) parameters
-create:expression: "vyatta-vtysh -c \"configure terminal\" \
- -c \"router ospf\" "
-delete:expression: "vyatta-vtysh -c \"configure terminal\" \
- -c \"no router ospf\" "
+create: /opt/vyatta/sbin/vyatta-protocol start ospf
+ vyatta-vtysh -c "configure terminal" -c "router ospf"
+delete: vyatta-vtysh -c "configure terminal" -c "no router ospf"
+ /opt/vyatta/sbin/vyatta-protocol stop ospf
diff --git a/templates/protocols/rip/node.def b/templates/protocols/rip/node.def
index 38d3da1a..f1a08cc5 100644
--- a/templates/protocols/rip/node.def
+++ b/templates/protocols/rip/node.def
@@ -1,4 +1,7 @@
help: Configure Routing Information Protocol (RIP) parameters
-create:expression: "vyatta-vtysh -c \"configure terminal\" -c \"router rip\" "
-delete:expression: "vyatta-vtysh -c \"configure terminal\" -c \"no router rip\" "
+create: /opt/vyatta/sbin/vyatta-protocol start rip
+ vyatta-vtysh -c "configure terminal" -c "router rip"
+delete: vyatta-vtysh -c "configure terminal" -c "no router rip"
+ /opt/vyatta/sbin/vyatta-protocol stop rip
+
diff --git a/templates/protocols/ripng/node.def b/templates/protocols/ripng/node.def
index 77991f97..efe56ba3 100644
--- a/templates/protocols/ripng/node.def
+++ b/templates/protocols/ripng/node.def
@@ -1,7 +1,5 @@
help: Configure Routing Information Protocol (RIPng) parameters
-
-create: vyatta-vtysh -c "configure terminal" \
- -c "router ripng"
-
-delete: vyatta-vtysh -c "configure terminal" \
- -c "no router ripng"
+create: /opt/vyatta/sbin/vyatta-protocol start ripng
+ vyatta-vtysh -c "configure terminal" -c "router ripng"
+delete: vyatta-vtysh -c "configure terminal" -c "no router ripng"
+ /opt/vyatta/sbin/vyatta-protocol stop ripng