diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-06-03 09:39:46 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-07-09 16:50:06 -0700 |
commit | 16d65ac258ef19fb80c2f7b01030a87d185fd3e1 (patch) | |
tree | fed3bf86480b252f6672d9cd8f300a02f2096731 | |
parent | 67ab58c6668dce8af9b98eb96bfe1b714409e08f (diff) | |
download | vyatta-cfg-quagga-16d65ac258ef19fb80c2f7b01030a87d185fd3e1.tar.gz vyatta-cfg-quagga-16d65ac258ef19fb80c2f7b01030a87d185fd3e1.zip |
Allow status operations as non-root user
(cherry picked from commit 466426dba5880bf469b22172769c552cf6aaaab0)
-rwxr-xr-x | scripts/quagga-manager | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/quagga-manager b/scripts/quagga-manager index ff0c7f88..220a5fba 100755 --- a/scripts/quagga-manager +++ b/scripts/quagga-manager @@ -15,11 +15,6 @@ if [ $# -lt 1 ]; then usage fi -if [ $EUID -ne 0 ]; then - echo "must be root!" - exit 1 -fi - pid_dir=/var/run/vyatta/quagga log_dir=/var/log/vyatta/quagga @@ -37,6 +32,11 @@ start() { local pidfile=${pid_dir}/${daemon}.pid local binpath=/usr/sbin/vyatta-$daemon + if [ $EUID -ne 0 ]; then + echo "must be root!" + exit 1 + fi + if [ ! -x $binpath ]; then echo "Unknown daemon $daemon" return 1 @@ -57,6 +57,10 @@ stop() { local pidfile=${pid_dir}/${daemon}.pid local binpath=/usr/sbin/vyatta-$daemon + if [ $EUID -ne 0 ]; then + echo "must be root!" + exit 1 + fi start-stop-daemon --stop --quiet --oknodo --retry 5 \ --exec $binpath --pidfile=$pidfile rm -f $pidfile |