From 16d65ac258ef19fb80c2f7b01030a87d185fd3e1 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Wed, 3 Jun 2009 09:39:46 -0700 Subject: Allow status operations as non-root user (cherry picked from commit 466426dba5880bf469b22172769c552cf6aaaab0) --- scripts/quagga-manager | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3