summaryrefslogtreecommitdiffstats
path: root/meta-eca/recipes-connectivity/connman/files/connman
diff options
context:
space:
mode:
Diffstat (limited to 'meta-eca/recipes-connectivity/connman/files/connman')
-rw-r--r--meta-eca/recipes-connectivity/connman/files/connman61
1 files changed, 61 insertions, 0 deletions
diff --git a/meta-eca/recipes-connectivity/connman/files/connman b/meta-eca/recipes-connectivity/connman/files/connman
new file mode 100644
index 0000000..4a0017f
--- /dev/null
+++ b/meta-eca/recipes-connectivity/connman/files/connman
@@ -0,0 +1,61 @@
1#!/bin/sh
2
3DAEMON=/usr/sbin/connmand
4PIDFILE=/var/run/connmand.pid
5DESC="Connection Manager"
6
7if [ -f /etc/default/connman ] ; then
8 . /etc/default/connman
9fi
10
11set -e
12
13nfsroot=0
14
15exec 9<&0 < /proc/mounts
16while read dev mtpt fstype rest; do
17 if test $mtpt = "/" ; then
18 case $fstype in
19 nfs | nfs4)
20 nfsroot=1
21 break
22 ;;
23 *)
24 ;;
25 esac
26 fi
27done
28
29do_start() {
30 EXTRA_PARAM=""
31 if test $nfsroot -eq 0 ; then
32 $DAEMON $EXTRA_PARAM
33 fi
34}
35
36do_stop() {
37 start-stop-daemon --stop --name connmand --quiet
38}
39
40case "$1" in
41 start)
42 echo "Starting $DESC"
43 do_start
44 ;;
45 stop)
46 echo "Stopping $DESC"
47 do_stop
48 ;;
49 restart|force-reload)
50 echo "Restarting $DESC"
51 do_stop
52 sleep 1
53 do_start
54 ;;
55 *)
56 echo "Usage: $0 {start|stop|restart|force-reload}" >&2
57 exit 1
58 ;;
59esac
60
61exit 0