wok view connman/stuff/etc/init.d/connman @ rev 14383

connman: fix deps+bdeps
author Dominique Corbex <domcox@slitaz.org>
date Tue Apr 23 06:56:06 2013 +0200 (2013-04-23)
parents d8e8e6421a2c
children dc0132468c26
line source
1 #!/bin/sh
2 # /etc/init.d/connman : Start, stop and restart the connexion manager
3 # on SliTaz, at boot time or with the command line.
4 #
5 # To start the connexion manager at boot time, just put connman 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=Connman
13 DESC="Connexion Manager"
14 DAEMON=/usr/sbin/connmand
15 OPTIONS=$CONNMAN_OPTIONS
16 PIDFILE=/run/connman
18 case "$1" in
19 start)
20 if [ -d $PIDFILE ] ; then
21 echo "$NAME already running."
22 exit 1
23 fi
24 echo -n "Starting $DESC: $NAME... "
25 $DAEMON $OPTIONS
26 status
27 ;;
28 stop)
29 if [ -z "$(pidof connmand)" ] ; then
30 echo "$NAME is not running."
31 rm -rf $PIDFILE
32 exit 1
33 fi
34 echo -n "Stopping $DESC: $NAME... "
35 rm -rf $PIDFILE
36 kill $(pidof connmand)
37 status
38 ;;
39 restart)
40 if [ -z "$(pidof connmand)" ]; 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 connmand) &&
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