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

busybox: 2015
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Jan 17 12:02:13 2015 +0100 (2015-01-17)
parents 8ebec64e4191
children 7f188676b59c
line source
1 #!/bin/sh
2 # /etc/init.d/connman : Start, stop and restart the connection manager
3 # on SliTaz, at boot time or with the command line.
4 #
5 # To start the connection 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="Connection Manager"
14 DAEMON=connmand
15 OPTIONS=$CONNMAN_OPTIONS
16 PIDFILE="$(pidof $DAEMON)"
18 case "$1" in
19 start)
20 if [ -n "$PIDFILE" ] ; then
21 echo "$NAME is already running."
22 exit 1
23 fi
24 pkill udhcpc 2>/dev/null
25 echo -n "Starting $DESC: $NAME... "
26 $DAEMON $OPTIONS
27 status
28 ;;
29 stop)
30 if [ -z "$PIDFILE" ] ; then
31 echo "$NAME is not running."
32 exit 1
33 fi
34 echo -n "Stopping $DESC: $NAME... "
35 pkill $DAEMON
36 pkill wpa_supplicant
37 status
38 ;;
39 restart)
40 if [ -z "$PIDFILE" ] ; then
41 echo "$NAME is not running."
42 exit 1
43 fi
44 echo -n "Restarting $DESC: $NAME... "
45 pkill $DAEMON &&
46 pkill wpa_supplicant &&
47 sleep 2 &&
48 $DAEMON $OPTIONS
49 status
50 ;;
51 status)
52 if [ -n "$PIDFILE" ] ; then
53 echo "$NAME is running."
54 else
55 echo "$NAME is not running."
56 fi
57 ;;
58 *)
59 printf "\n\033[1mUsage:\033[0m /etc/init.d/%b [start|stop|restart|status]\n" \
60 "$(basename $0)"
61 exit 1
62 ;;
63 esac
65 exit 0