Fixed the init script to start/stop pndnotifyd for release
[pandora-libraries.git] / testdata / sh / pndnotifyd
1 #! /bin/sh 
2 #
3 ### BEGIN INIT INFO
4 # Provides:          pndnotifyd
5 # Required-Start:    #adjust
6 # Required-Stop:     #adjust
7 # Default-Start:     2 3 4 5
8 # Default-Stop:      0 1 6
9 ### END INIT INFO
10  
11 PID=`pidof -o %PPID -x pndnotifyd`
12
13 # for testing
14 #LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/user/libpnd/pandora-libraries #remove
15 #export LD_LIBRARY_PATH #remove
16 #PNDNOTIFY='/home/user/libpnd/pandora-libraries/bin/pndnotifyd' #adjust
17
18 PNDNOTIFY='/usr/bin/pndnotifyd'
19  
20 case "$1" in
21 start)
22         # Start daemon.
23         echo "starting $PID"
24                         if [ $PID ]
25                         then
26                                 echo "pndnotifyd already running."
27                         else
28                                 $PNDNOTIFY -d
29                                 echo "started pndnotifyd"
30                         fi
31  
32         ;;
33 stop)
34         # Stop daemon.
35         kill $PID
36         ;;
37 reload)
38         kill -HUP $PID
39         ;;
40 restart|force-reload)
41         $0 stop
42         $0 start
43     ;;
44 *)
45         echo "Usage: $0 {start|stop|restart|reload|force-reload}" >&2
46         exit 2
47         ;;
48 esac
49 exit 0
50