diff options
Diffstat (limited to 'meta-eca/recipes-connectivity/connman/files/connman')
-rw-r--r-- | meta-eca/recipes-connectivity/connman/files/connman | 61 |
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 | |||
3 | DAEMON=/usr/sbin/connmand | ||
4 | PIDFILE=/var/run/connmand.pid | ||
5 | DESC="Connection Manager" | ||
6 | |||
7 | if [ -f /etc/default/connman ] ; then | ||
8 | . /etc/default/connman | ||
9 | fi | ||
10 | |||
11 | set -e | ||
12 | |||
13 | nfsroot=0 | ||
14 | |||
15 | exec 9<&0 < /proc/mounts | ||
16 | while 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 | ||
27 | done | ||
28 | |||
29 | do_start() { | ||
30 | EXTRA_PARAM="" | ||
31 | if test $nfsroot -eq 0 ; then | ||
32 | $DAEMON $EXTRA_PARAM | ||
33 | fi | ||
34 | } | ||
35 | |||
36 | do_stop() { | ||
37 | start-stop-daemon --stop --name connmand --quiet | ||
38 | } | ||
39 | |||
40 | case "$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 | ;; | ||
59 | esac | ||
60 | |||
61 | exit 0 | ||