diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-09 14:38:50 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-09 14:38:50 -0700 |
commit | 61a47e2f6c508330e779ac10e9b9d7cd0303bd5d (patch) | |
tree | d746937f89910025d6b4d7e8f6847018b3d288a8 | |
parent | 037812d76a2bac67b20f75f42734581d915c8649 (diff) | |
download | vyatta-cfg-quagga-61a47e2f6c508330e779ac10e9b9d7cd0303bd5d.tar.gz vyatta-cfg-quagga-61a47e2f6c508330e779ac10e9b9d7cd0303bd5d.zip |
Allow starting multiple daemons at once
Avoid having to run script multiple times.
-rwxr-xr-x | scripts/quagga-manager | 28 |
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 |