summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@io.vyatta.com>2009-02-16 18:02:17 -0800
committerStig Thormodsrud <stig@io.vyatta.com>2009-02-16 18:02:17 -0800
commitc45f7b9f8daae3b96c76fac3363a507c22b9d9f3 (patch)
treeb8e46d0fe080426aaa9beca23cd843a0212ee73f
parent0f4a6d1a24f937aafc6ba2014c94dc42cf9251eb (diff)
parent5205f4cd0d68a78c86fce6588f9c276861bb9cdd (diff)
downloadvyatta-cfg-quagga-c45f7b9f8daae3b96c76fac3363a507c22b9d9f3.tar.gz
vyatta-cfg-quagga-c45f7b9f8daae3b96c76fac3363a507c22b9d9f3.zip
Merge branch 'jenner' of http://git.vyatta.com/vyatta-cfg-quagga into jenner
-rwxr-xr-xscripts/vyatta-protocol26
-rw-r--r--templates/protocols/bgp/disable/node.def12
-rw-r--r--templates/protocols/bgp/node.def8
-rw-r--r--templates/protocols/bgp/node.tag/node.def0
-rw-r--r--templates/protocols/ospf/disable/node.def12
-rw-r--r--templates/protocols/ospf/node.def4
-rw-r--r--templates/protocols/rip/disable/node.def12
-rw-r--r--templates/protocols/rip/node.def6
-rw-r--r--templates/protocols/ripng/disable/node.def12
-rw-r--r--templates/protocols/ripng/node.def4
10 files changed, 67 insertions, 29 deletions
diff --git a/scripts/vyatta-protocol b/scripts/vyatta-protocol
index ba68e9e9..65ee3d76 100755
--- a/scripts/vyatta-protocol
+++ b/scripts/vyatta-protocol
@@ -5,13 +5,14 @@
progname=$0
usage() {
echo "Usage: $progname {start|stop|restart} {bgpd|ospfd|ripd|ripngd}"
- exit 1;
+ exit 1
}
if [ $# -lt 2 ]; then
usage
fi
+
daemon=$2
exe_file=/usr/sbin/vyatta-$daemon
@@ -21,15 +22,20 @@ log_dir=/var/log/vyatta/quagga
if [ ! -x $exe_file ]; then
echo "Unknown daemon $daemon"
- exit 1;
+ exit 1
+fi
+
+if [ $EUID -ne 0 ]; then
+ echo "must be root!"
+ exit 1
fi
case "$1" in
start)
- sudo start-stop-daemon --start --quiet \
+ start-stop-daemon --start --quiet \
--chdir $log_dir --exec $exe_file \
-- -d -P 0 -i $pid_dir/${daemon}.pid
- sudo start-stop-daemon --start --quiet \
+ start-stop-daemon --start --quiet \
--chdir $log_dir \
--exec /usr/sbin/vyatta-watchquagga \
-- -p $pid_dir/watch-${daemon}.pid \
@@ -37,18 +43,18 @@ case "$1" in
;;
stop)
- sudo start-stop-daemon --stop --quiet --oknodo --retry 2 \
+ start-stop-daemon --stop --quiet --oknodo --retry 2 \
--pidfile $pid_dir/watch-${daemon}.pid
- sudo rm -f $pid_dir/watch-${daemon}.pid
- sudo start-stop-daemon --stop --quiet --oknodo --retry 2 \
+ rm -f $pid_dir/watch-${daemon}.pid
+ start-stop-daemon --stop --quiet --oknodo --retry 2 \
--exec $exe_file
- sudo rm -f $pid_dir/${daemon}.pid
+ rm -f $pid_dir/${daemon}.pid
;;
restart)
# Restart daemon
- sudo start-stop-daemon --stop --quiet --oknodo --exec $exe_file
- sudo start-stop-daemon --start --quiet \
+ start-stop-daemon --stop --quiet --oknodo --exec $exe_file
+ start-stop-daemon --start --quiet \
--chdir $log_dir --exec $exe_file \
-- -d -P 0 -i $pid_dir/${daemon}.pid
diff --git a/templates/protocols/bgp/disable/node.def b/templates/protocols/bgp/disable/node.def
new file mode 100644
index 00000000..2795453f
--- /dev/null
+++ b/templates/protocols/bgp/disable/node.def
@@ -0,0 +1,12 @@
+type: bool
+help: Disable BGP daemon
+default: false
+update: if [ $VAR(@) == "true" ];
+ then sudo ${vyatta_sbindir}/vyatta-protocol stop bgpd
+ else sudo ${vyatta_sbindir}/vyatta-protocol start bgpd
+ fi
+possible completions:
+ true Stop BGP daemon
+ false Start BGP daemon
+
+allowed: echo "true false"
diff --git a/templates/protocols/bgp/node.def b/templates/protocols/bgp/node.def
index ca1ae005..520da78f 100644
--- a/templates/protocols/bgp/node.def
+++ b/templates/protocols/bgp/node.def
@@ -5,15 +5,7 @@ comp_help: \1 <1-4294967294>\tAS number
syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 4294967294 ; \
"AS number must be between 1 and 4294967294"
-create: if [ $(pgrep -c -x vyatta-bgpd) -eq 0 ]
- then ${vyatta_sbindir}/vyatta-protocol start bgpd
- 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(@)"
- if ! ${vyatta_sbindir}/vyatta-check-typeless-node.pl "protocols bgp"
- then ${vyatta_sbindir}/vyatta-protocol stop bgpd
- fi
diff --git a/templates/protocols/bgp/node.tag/node.def b/templates/protocols/bgp/node.tag/node.def
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/templates/protocols/bgp/node.tag/node.def
diff --git a/templates/protocols/ospf/disable/node.def b/templates/protocols/ospf/disable/node.def
new file mode 100644
index 00000000..eeccb9a1
--- /dev/null
+++ b/templates/protocols/ospf/disable/node.def
@@ -0,0 +1,12 @@
+type: bool
+help: Disable OSPF daemon
+default: false
+update: if [ $VAR(@) == "true" ];
+ then sudo ${vyatta_sbindir}/vyatta-protocol stop ospfd
+ else sudo ${vyatta_sbindir}/vyatta-protocol start ospfd
+ fi
+possible completions:
+ true Stop OSPF daemon
+ false Start OSPF daemon
+
+allowed: echo "true false"
diff --git a/templates/protocols/ospf/node.def b/templates/protocols/ospf/node.def
index 5405abac..b28f5553 100644
--- a/templates/protocols/ospf/node.def
+++ b/templates/protocols/ospf/node.def
@@ -1,5 +1,3 @@
help: Configure Open Shortest Path First protocol (OSPF) parameters
-create: /opt/vyatta/sbin/vyatta-protocol start ospfd
- vyatta-vtysh -c "configure terminal" -c "router ospf"
+create: vyatta-vtysh -c "configure terminal" -c "router ospf"
delete: vyatta-vtysh -c "configure terminal" -c "no router ospf"
- /opt/vyatta/sbin/vyatta-protocol stop ospfd
diff --git a/templates/protocols/rip/disable/node.def b/templates/protocols/rip/disable/node.def
new file mode 100644
index 00000000..4cd56588
--- /dev/null
+++ b/templates/protocols/rip/disable/node.def
@@ -0,0 +1,12 @@
+type: bool
+help: Disable RIP daemon
+default: false
+update: if [ $VAR(@) == "true" ];
+ then sudo ${vyatta_sbindir}/vyatta-protocol stop ripd
+ else sudo ${vyatta_sbindir}/vyatta-protocol start ripd
+ fi
+possible completions:
+ true Stop RIP daemon
+ false Start RIP daemon
+
+allowed: echo "true false"
diff --git a/templates/protocols/rip/node.def b/templates/protocols/rip/node.def
index a77bdb30..541baa8d 100644
--- a/templates/protocols/rip/node.def
+++ b/templates/protocols/rip/node.def
@@ -1,7 +1,3 @@
help: Configure Routing Information Protocol (RIP) parameters
-create: /opt/vyatta/sbin/vyatta-protocol start ripd
- vyatta-vtysh -c "configure terminal" -c "router rip"
+create: vyatta-vtysh -c "configure terminal" -c "router rip"
delete: vyatta-vtysh -c "configure terminal" -c "no router rip"
- /opt/vyatta/sbin/vyatta-protocol stop ripd
-
-
diff --git a/templates/protocols/ripng/disable/node.def b/templates/protocols/ripng/disable/node.def
new file mode 100644
index 00000000..d23c9c5f
--- /dev/null
+++ b/templates/protocols/ripng/disable/node.def
@@ -0,0 +1,12 @@
+type: bool
+help: Disable RIPng daemon
+default: false
+update: if [ $VAR(@) == "true" ];
+ then sudo ${vyatta_sbindir}/vyatta-protocol stop ripngd
+ else sudo ${vyatta_sbindir}/vyatta-protocol start ripngd
+ fi
+possible completions:
+ true Stop RIPng daemon
+ false Start RIPng daemon
+
+allowed: echo "true false"
diff --git a/templates/protocols/ripng/node.def b/templates/protocols/ripng/node.def
index 18735607..61c30b01 100644
--- a/templates/protocols/ripng/node.def
+++ b/templates/protocols/ripng/node.def
@@ -1,5 +1,3 @@
help: Configure Routing Information Protocol (RIPng) parameters
-create: /opt/vyatta/sbin/vyatta-protocol start ripngd
- vyatta-vtysh -c "configure terminal" -c "router ripng"
+create: vyatta-vtysh -c "configure terminal" -c "router ripng"
delete: vyatta-vtysh -c "configure terminal" -c "no router ripng"
- /opt/vyatta/sbin/vyatta-protocol stop ripngd