wok-current view ofono/stuff/etc/init.d/ofono @ rev 16274

Up: git (1.9.1)
author Alexander Medvedev <devl547@gmail.com>
date Sat Apr 05 21:34:07 2014 +0000 (2014-04-05)
parents 274af13ca754
children 7f188676b59c
line source
1 #!/bin/sh
2 # /etc/init.d/ofono : Start, stop and restart the Mobile Telephony manager
3 # on SliTaz, at boot time or with the command line.
4 #
5 # To start the Mobile Telephony manager at boot time, just put ofono in the
6 # $RUN_DAEMONS variable of /etc/rcS.conf and configure options with
7 # /etc/daemons.conf
8 #
9 . /etc/init.d/rc.functions
10 . /etc/daemons.conf
12 NAME=Ofono
13 DESC="Mobile telephony Manager"
14 DAEMON=/usr/sbin/ofonod
15 OPTIONS=$OFONO_OPTIONS
16 PIDFILE=/var/run/ofono.pid
18 case "$1" in
19 start)
20 if active_pidfile $PIDFILE ofonod ; then
21 echo "$NAME already running."
22 exit 1
23 fi
24 echo -n "Starting $DESC: $NAME... "
25 $DAEMON $OPTIONS
26 status
27 pidof ofonod > $PIDFILE
28 ;;
29 stop)
30 if ! active_pidfile $PIDFILE ofonod ; then
31 echo "$NAME is not running."
32 exit 1
33 fi
34 echo -n "Stopping $DESC: $NAME... "
35 rm -rf $PIDFILE
36 kill $(pidof ofonod)
37 status
38 ;;
39 restart)
40 if ! active_pidfile $PIDFILE ofonod ; then
41 echo "$NAME is not running."
42 exit 1
43 fi
44 echo -n "Restarting $DESC: $NAME... "
45 rm -rf $PIDFILE
46 kill $(pidof ofonod) &&
47 sleep 2 &&
48 $DAEMON $OPTIONS
49 status
50 ;;
51 *)
52 printf "\n\033[1mUsage:\033[0m /etc/init.d/%b [start|stop|restart]\n" \
53 "$(basename $0)"
54 exit 1
55 ;;
56 esac
58 exit 0