wok annotate connman/stuff/etc/init.d/connman @ rev 24986
Up nettle 3.7.3 again, need glib-networking rebuild to no break midori
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Wed May 11 08:28:28 2022 -0400 (2022-05-11) |
parents | 7f188676b59c |
children |
rev | line source |
---|---|
domcox@14329 | 1 #!/bin/sh |
mojo@15712 | 2 # /etc/init.d/connman : Start, stop and restart the connection manager |
domcox@14329 | 3 # on SliTaz, at boot time or with the command line. |
domcox@14329 | 4 # |
mojo@15712 | 5 # To start the connection 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 # |
mojo@21166 | 9 |
mojo@21166 | 10 # Connmand start fails if dbus-daemon is not running. |
mojo@21166 | 11 [ -n "$(pidof dbus-daemon)" ] || /etc/init.d/dbus start |
mojo@21166 | 12 |
domcox@14329 | 13 . /etc/init.d/rc.functions |
domcox@14329 | 14 . /etc/daemons.conf |
domcox@14329 | 15 |
domcox@14329 | 16 NAME=Connman |
al@19159 | 17 DESC="$(_ 'Connection Manager')" |
mojo@15712 | 18 DAEMON=connmand |
domcox@14329 | 19 OPTIONS=$CONNMAN_OPTIONS |
mojo@15712 | 20 PIDFILE="$(pidof $DAEMON)" |
domcox@14329 | 21 |
domcox@14329 | 22 case "$1" in |
domcox@14329 | 23 start) |
mojo@15712 | 24 if [ -n "$PIDFILE" ] ; then |
al@19159 | 25 _ '%s is already running.' $NAME |
domcox@14329 | 26 exit 1 |
domcox@14329 | 27 fi |
mojo@15712 | 28 pkill udhcpc 2>/dev/null |
al@19159 | 29 action 'Starting %s: %s...' "$DESC" $NAME |
domcox@14329 | 30 $DAEMON $OPTIONS |
domcox@14329 | 31 status |
domcox@14329 | 32 ;; |
domcox@14329 | 33 stop) |
mojo@15712 | 34 if [ -z "$PIDFILE" ] ; then |
al@19159 | 35 _ '%s is not running.' $NAME |
domcox@14329 | 36 exit 1 |
domcox@14329 | 37 fi |
al@19159 | 38 action 'Stopping %s: %s...' "$DESC" $NAME |
mojo@15712 | 39 pkill $DAEMON |
mojo@15712 | 40 pkill wpa_supplicant |
pascal@15577 | 41 status |
domcox@14329 | 42 ;; |
domcox@14329 | 43 restart) |
mojo@15712 | 44 if [ -z "$PIDFILE" ] ; then |
al@19159 | 45 _ '%s is not running.' $NAME |
domcox@14329 | 46 exit 1 |
domcox@14329 | 47 fi |
al@19159 | 48 action 'Restarting %s: %s...' "$DESC" $NAME |
mojo@15712 | 49 pkill $DAEMON && |
mojo@15712 | 50 pkill wpa_supplicant && |
domcox@14329 | 51 sleep 2 && |
domcox@14329 | 52 $DAEMON $OPTIONS |
domcox@14329 | 53 status |
domcox@14329 | 54 ;; |
mojo@15712 | 55 status) |
mojo@15712 | 56 if [ -n "$PIDFILE" ] ; then |
al@19159 | 57 _ '%s is running.' $NAME |
mojo@15712 | 58 else |
al@19159 | 59 _ '%s is not running.' $NAME |
al@19159 | 60 fi |
mojo@15712 | 61 ;; |
domcox@14329 | 62 *) |
al@19159 | 63 emsg "<n><b>$(_ 'Usage:')</b> $0 [start|stop|restart|status]" |
al@19159 | 64 newline |
domcox@14329 | 65 ;; |
domcox@14329 | 66 esac |
domcox@14329 | 67 |
domcox@14329 | 68 exit 0 |