Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release > by-pkgid > 2eb4e04b7eb11f7cbdc76422713463de > files > 10

abcde-2.4.1-1mdv2010.1.x86_64.rpm

#!/bin/sh

##########
# The first argument tells what to do.
##########

RUNNING=`ps -ef|grep [a]bcded|awk '{ print $2 }'`

state=$1

case $state in
start)

        if [ -n "$RUNNING"  ]; then
                echo "abcde daemon already running."
                exit 0
        fi

        echo "Starting abcde daemon"
        abcded &
        echo "Done."
        ;;
stop)
        if [ -n "$RUNNING"  ]; then
           /bin/kill -9 $RUNNING > /dev/null
           if [ $? = 0 ]; then
                echo "abcde daemon killed"
           fi
        fi
        ;;
restart)
        $0 stop
        $0 start
        ;;
*)
        echo "Usage: $0 {start|stop|restart}"
        exit 1
esac