wok-6.x annotate connman/stuff/etc/init.d/connman @ rev 15033
conky: typo
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Aug 12 11:34:36 2013 +0000 (2013-08-12) |
parents | d8e8e6421a2c |
children | dc0132468c26 |
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@14383 | 31 rm -rf $PIDFILE |
domcox@14329 | 32 exit 1 |
domcox@14329 | 33 fi |
domcox@14329 | 34 echo -n "Stopping $DESC: $NAME... " |
domcox@14329 | 35 rm -rf $PIDFILE |
domcox@14329 | 36 kill $(pidof connmand) |
domcox@14329 | 37 status |
domcox@14329 | 38 ;; |
domcox@14329 | 39 restart) |
domcox@14329 | 40 if [ -z "$(pidof connmand)" ]; then |
domcox@14329 | 41 echo "$NAME is not running." |
domcox@14329 | 42 exit 1 |
domcox@14329 | 43 fi |
domcox@14329 | 44 echo -n "Restarting $DESC: $NAME... " |
domcox@14329 | 45 rm -rf $PIDFILE |
domcox@14329 | 46 kill $(pidof connmand) && |
domcox@14329 | 47 sleep 2 && |
domcox@14329 | 48 $DAEMON $OPTIONS |
domcox@14329 | 49 status |
domcox@14329 | 50 ;; |
domcox@14329 | 51 *) |
domcox@14383 | 52 printf "\n\033[1mUsage:\033[0m /etc/init.d/%b [start|stop|restart]\n" \ |
domcox@14383 | 53 "$(basename $0)" |
domcox@14329 | 54 exit 1 |
domcox@14329 | 55 ;; |
domcox@14329 | 56 esac |
domcox@14329 | 57 |
domcox@14329 | 58 exit 0 |