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

connman: kill dhcpd before starting
author Dominique Corbex <domcox@slitaz.org>
date Sun Nov 17 16:55:13 2013 +0100 (2013-11-17)
parents 0199371990b2
children 8ebec64e4191
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 killall udhcpc 2>/dev/null
25 echo -n "Starting $DESC: $NAME... "
26 $DAEMON $OPTIONS
27 status
28 ;;
29 stop)
30 if [ -z "$(pidof connmand)" ] ; then
31 echo "$NAME is not running."
32 rm -rf $PIDFILE
33 exit 1
34 fi
35 echo -n "Stopping $DESC: $NAME... "
36 rm -rf $PIDFILE
37 kill $(pidof connmand)
38 status
39 ;;
40 restart)
41 if [ -z "$(pidof connmand)" ]; then
42 echo "$NAME is not running."
43 exit 1
44 fi
45 echo -n "Restarting $DESC: $NAME... "
46 rm -rf $PIDFILE
47 kill $(pidof connmand) &&
48 sleep 2 &&
49 $DAEMON $OPTIONS
50 status
51 ;;
52 *)
53 printf "\n\033[1mUsage:\033[0m /etc/init.d/%b [start|stop|restart]\n" \
54 "$(basename $0)"
55 exit 1
56 ;;
57 esac
59 exit 0