wok annotate 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
rev   line source
domcox@14329 1 #!/bin/sh
domcox@14329 2 # /etc/init.d/connman : Start, stop and restart the connexion manager
domcox@14329 3 # on SliTaz, at boot time or with the command line.
domcox@14329 4 #
domcox@14329 5 # To start the connexion manager at boot time, just put connman in the
domcox@14329 6 # $RUN_DAEMONS variable of /etc/rcS.conf and configure options with
domcox@14329 7 # /etc/daemons.conf
domcox@14329 8 #
domcox@14329 9 . /etc/init.d/rc.functions
domcox@14329 10 . /etc/daemons.conf
domcox@14329 11
domcox@14329 12 NAME=Connman
domcox@14329 13 DESC="Connexion Manager"
domcox@14329 14 DAEMON=/usr/sbin/connmand
domcox@14329 15 OPTIONS=$CONNMAN_OPTIONS
domcox@14329 16 PIDFILE=/run/connman
domcox@14329 17
domcox@14329 18 case "$1" in
domcox@14329 19 start)
domcox@14329 20 if [ -d $PIDFILE ] ; then
domcox@14329 21 echo "$NAME already running."
domcox@14329 22 exit 1
domcox@14329 23 fi
domcox@14329 24 echo -n "Starting $DESC: $NAME... "
domcox@14329 25 $DAEMON $OPTIONS
domcox@14329 26 status
domcox@14329 27 ;;
domcox@14329 28 stop)
domcox@14329 29 if [ -z "$(pidof connmand)" ] ; then
domcox@14329 30 echo "$NAME is not running."
domcox@14329 31 exit 1
domcox@14329 32 fi
domcox@14329 33 echo -n "Stopping $DESC: $NAME... "
domcox@14329 34 rm -rf $PIDFILE
domcox@14329 35 kill $(pidof connmand)
domcox@14329 36 status
domcox@14329 37 ;;
domcox@14329 38 restart)
domcox@14329 39 if [ -z "$(pidof connmand)" ]; then
domcox@14329 40 echo "$NAME is not running."
domcox@14329 41 exit 1
domcox@14329 42 fi
domcox@14329 43 echo -n "Restarting $DESC: $NAME... "
domcox@14329 44 rm -rf $PIDFILE
domcox@14329 45 kill $(pidof connmand) &&
domcox@14329 46 sleep 2 &&
domcox@14329 47 $DAEMON $OPTIONS
domcox@14329 48 status
domcox@14329 49 ;;
domcox@14329 50 *)
domcox@14329 51 echo ""
domcox@14329 52 echo -e "\033[1mUsage:\033[0m /etc/init.d/$(basename $0) [start|stop|restart]"
domcox@14329 53 echo ""
domcox@14329 54 exit 1
domcox@14329 55 ;;
domcox@14329 56 esac
domcox@14329 57
domcox@14329 58 exit 0