wok view ofono/stuff/etc/init.d/ofono @ rev 20015

Up reaver (1.6.1)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Aug 11 12:10:52 2017 +0200 (2017-08-11)
parents 8ebec64e4191
children
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 _ '%s is already running.' $NAME
22 exit 1
23 fi
24 action 'Starting %s: %s...' "$DESC" $NAME
25 $DAEMON $OPTIONS
26 status
27 pidof ofonod > $PIDFILE
28 ;;
29 stop)
30 if ! active_pidfile $PIDFILE ofonod ; then
31 _ '%s is not running.' $NAME
32 exit 1
33 fi
34 action 'Stopping %s: %s...' "$DESC" $NAME
35 rm -rf $PIDFILE
36 kill $(pidof ofonod)
37 status
38 ;;
39 restart)
40 if ! active_pidfile $PIDFILE ofonod ; then
41 _ '%s is not running.' $NAME
42 exit 1
43 fi
44 action 'Restarting %s: %s...' "$DESC" $NAME
45 rm -rf $PIDFILE
46 kill $(pidof ofonod) &&
47 sleep 2 &&
48 $DAEMON $OPTIONS
49 status
50 ;;
51 *)
52 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart]"
53 newline
54 ;;
55 esac
57 exit 0