summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-09 14:38:50 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-10-13 16:38:18 -0700
commitcbae9ecf21faa3d98eda8f6f81a86808042e7a56 (patch)
tree36c61d310d94292d072ce40b3031b2eb15342033 /scripts
parent5cd048b332bc3fba71ae4ceb57947aac3e3ef38c (diff)
downloadvyatta-cfg-quagga-cbae9ecf21faa3d98eda8f6f81a86808042e7a56.tar.gz
vyatta-cfg-quagga-cbae9ecf21faa3d98eda8f6f81a86808042e7a56.zip
Allow starting multiple daemons at once
Avoid having to run script multiple times. (cherry picked from commit 61a47e2f6c508330e779ac10e9b9d7cd0303bd5d)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/quagga-manager28
1 files changed, 16 insertions, 12 deletions
diff --git a/scripts/quagga-manager b/scripts/quagga-manager
index be0435b9..5beb8780 100755
--- a/scripts/quagga-manager
+++ b/scripts/quagga-manager
@@ -7,7 +7,7 @@
# echo $* | logger -p local7.debug -t quagga-manager
usage() {
- echo "Usage: $0 {check|start|stop|restart} {bgpd|ospfd|ripd|ospf6d|ripngd}"
+ echo "Usage: $0 {check|start|stop|restart} {bgpd|ospfd|ripd|ospf6d|ripngd} ..."
exit 1
}
@@ -48,9 +48,8 @@ start() {
bgpd) args+=( -I );;
esac
- exec start-stop-daemon --start --oknodo --quiet \
- --chdir $log_dir --exec $binpath --pidfile $pidfile \
- -- ${args[@]}
+ start-stop-daemon --start --oknodo --quiet \
+ --chdir $log_dir --exec $binpath --pidfile $pidfile -- ${args[@]}
}
stop() {
@@ -117,12 +116,17 @@ reload_config() {
trap "" EXIT HUP INT QUIT TERM
}
-case "$1" in
- start) start $2;;
- stop) stop $2;;
- status) status $2;;
- reload) start $2; reload_config $2;;
- restart) stop $2; start $2;;
- *) usage;;
-esac
+action=$1
+shift
+
+for daemon; do
+ case "$action" in
+ start) start $daemon ;;
+ stop) stop $daemon ;;
+ status) status $daemon ;;
+ reload) start $daemon; reload_config $daemon ;;
+ restart) stop $daemon; start $daemon ;;
+ *) usage;;
+ esac
+done