summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2009-06-03 09:39:46 -0700
committerStephen Hemminger <stephen.hemminger@vyatta.com>2009-07-09 16:50:06 -0700
commit16d65ac258ef19fb80c2f7b01030a87d185fd3e1 (patch)
treefed3bf86480b252f6672d9cd8f300a02f2096731 /scripts
parent67ab58c6668dce8af9b98eb96bfe1b714409e08f (diff)
downloadvyatta-cfg-quagga-16d65ac258ef19fb80c2f7b01030a87d185fd3e1.tar.gz
vyatta-cfg-quagga-16d65ac258ef19fb80c2f7b01030a87d185fd3e1.zip
Allow status operations as non-root user
(cherry picked from commit 466426dba5880bf469b22172769c552cf6aaaab0)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/quagga-manager14
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