Modded the output for fields in the parser code
[clinton/abcde.git] / examples / abcde.init
CommitLineData
7acef70b 1#!/bin/sh
2
3##########
4# The first argument tells what to do.
5##########
6
7RUNNING=`ps -ef|grep [a]bcded|awk '{ print $2 }'`
8
9state=$1
10
11case $state in
12start)
13
14 if [ -n "$RUNNING" ]; then
15 echo "abcde daemon already running."
16 exit 0
17 fi
18
19 echo "Starting abcde daemon"
20 abcded &
21 echo "Done."
22 ;;
23stop)
24 if [ -n "$RUNNING" ]; then
25 /bin/kill -9 $RUNNING > /dev/null
26 if [ $? = 0 ]; then
27 echo "abcde daemon killed"
28 fi
29 fi
30 ;;
31restart)
32 $0 stop
33 $0 start
34 ;;
35*)
36 echo "Usage: $0 {start|stop|restart}"
37 exit 1
38esac
39