/[projects]/smsdaemon/scripts/smsdaemon-initscript
ViewVC logotype

Annotation of /smsdaemon/scripts/smsdaemon-initscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 204 - (hide annotations) (download)
Fri Dec 19 07:33:01 2008 UTC (15 years, 5 months ago) by torben
File size: 839 byte(s)
A much more simple initscript - which actually works !

1 torben 204 #! /bin/bash
2 torben 170
3     PIDFILE="/var/run/smsdaemon.pid"
4    
5 torben 204 function start_d
6     {
7     /usr/local/sbin/smsdaemon --daemon
8 torben 170 }
9    
10 torben 204 function stop_d
11 torben 170 {
12 torben 204 if [ -f $PIDFILE ] ; then
13     PID=`cat $PIDFILE`
14     LINES=`ps aux | grep smsdaemon | grep $PID | wc -l`
15     if [ "$LINES" == "1" ] ; then
16     kill $PID
17 torben 170 else
18 torben 204 echo "pidfile found -- but smsdaemon not running"
19 torben 170 fi
20 torben 204 else
21     echo "PIDFILE not found !!!!!!!!"
22     fi
23 torben 170 }
24    
25 torben 204 function status_d
26 torben 170 {
27 torben 204 if [ -f $PIDFILE ] ; then
28     PID=`cat $PIDFILE`
29     LINES=`ps aux | grep smsdaemon | grep $PID | wc -l`
30     if [ "$LINES" == "1" ] ; then
31     echo "smsdaemon running (pid=$PID)"
32     else
33     echo "pidfile found -- but smsdaemon not running"
34 torben 170 fi
35 torben 204 else
36     echo "no pidfile - smsdaemon not started"
37 torben 170 fi
38     }
39    
40 torben 204 case $1 in
41     "start")
42     start_d
43     ;;
44     "stop")
45     stop_d
46     ;;
47     "status")
48     status_d
49     ;;
50 torben 170 *)
51 torben 204 echo "Usage $0 [start|stop|status]"
52     ;;
53 torben 170 esac

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20