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

Contents of /smsdaemon/scripts/smsdaemon-initscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 204 - (show 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 #! /bin/bash
2
3 PIDFILE="/var/run/smsdaemon.pid"
4
5 function start_d
6 {
7 /usr/local/sbin/smsdaemon --daemon
8 }
9
10 function stop_d
11 {
12 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 else
18 echo "pidfile found -- but smsdaemon not running"
19 fi
20 else
21 echo "PIDFILE not found !!!!!!!!"
22 fi
23 }
24
25 function status_d
26 {
27 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 fi
35 else
36 echo "no pidfile - smsdaemon not started"
37 fi
38 }
39
40 case $1 in
41 "start")
42 start_d
43 ;;
44 "stop")
45 stop_d
46 ;;
47 "status")
48 status_d
49 ;;
50 *)
51 echo "Usage $0 [start|stop|status]"
52 ;;
53 esac

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20