- Check user's privileges before executing start/stop targets.

Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>

git-svn-id: http://svn.berlios.de/svnroot/repos/sems/trunk@1606 8eb893ce-cfd4-0310-b710-fb5ebe64c474
sayer/1.4-spce2.6
Peter Lemenkov 17 years ago
parent df0b626a46
commit f1812bcf7c

@ -39,6 +39,14 @@ RETVAL=0
start() {
echo -n $"Starting $prog: "
# Check user's rights (we need only creating/opening fds
# so we check only effective UID)
if [ $EUID -ne 0 ] ; then
echo -n "not enough rights" && failure && echo
RETVAL=4
return $RETVAL
fi
# check whether SEMS was already started
if pidofproc -p $pidfile > /dev/null 2>&1 ; then
echo -n "already running" && warning && echo
@ -55,6 +63,14 @@ start() {
stop() {
echo -n $"Stopping $prog: "
# Check user's rights (we need only creating/opening fds
# so we check only effective UID)
if [ $EUID -ne 0 ] ; then
echo -n "not enough rights" && failure && echo
RETVAL=4
return $RETVAL
fi
# check whether SEMS is running
if ! pidofproc -p $pidfile > /dev/null 2>&1 ; then
echo -n "not running" && warning && echo

Loading…
Cancel
Save