File: abcde.init

package info (click to toggle)
abcde 2.6-2
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 464 kB
  • ctags: 109
  • sloc: sh: 3,931; python: 210; perl: 136; makefile: 63
file content (39 lines) | stat: -rw-r--r-- 687 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/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