wok-current view connman/stuff/etc/init.d/connman @ rev 15577

Update some start scripts
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 29 11:43:20 2013 +0000 (2013-11-29)
parents dc0132468c26
children dec89a82ee60
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 active_pidfile $PIDFILE connmand ; 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 ! active_pidfile $PIDFILE connmand ; then
31 echo "$NAME is not running."
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 ! active_pidfile $PIDFILE 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