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

Up: connman (1.12)
author Dominique Corbex <domcox@slitaz.org>
date Fri Apr 12 19:56:50 2013 +0200 (2013-04-12)
parents
children 0199371990b2
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 exit 1
32 fi
33 echo -n "Stopping $DESC: $NAME... "
34 rm -rf $PIDFILE
35 kill $(pidof connmand)
36 status
37 ;;
38 restart)
39 if [ -z "$(pidof connmand)" ]; then
40 echo "$NAME is not running."
41 exit 1
42 fi
43 echo -n "Restarting $DESC: $NAME... "
44 rm -rf $PIDFILE
45 kill $(pidof connmand) &&
46 sleep 2 &&
47 $DAEMON $OPTIONS
48 status
49 ;;
50 *)
51 echo ""
52 echo -e "\033[1mUsage:\033[0m /etc/init.d/$(basename $0) [start|stop|restart]"
53 echo ""
54 exit 1
55 ;;
56 esac
58 exit 0