summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
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