1692b9502767c56f9d221e96627d09158a944191
[platform/upstream/connman.git] / scripts / connman.in
1 #!/bin/sh
2
3 DAEMON=@sbindir@/connmand
4 DESC="Connection Manager"
5
6 . /lib/lsb/init-functions
7
8 if [ -f @sysconfdir@/default/connman ] ; then
9         . @sysconfdir@/default/connman
10 fi
11
12 set -e
13
14 do_start() {
15         start-stop-daemon --start --oknodo --exec $DAEMON -- $DAEMON_OPTS
16 }
17
18 do_stop() {
19         start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
20 }
21
22 case "$1" in
23   start)
24         log_daemon_msg "Starting $DESC"
25         do_start
26         log_end_msg $?
27         ;;
28   stop)
29         log_daemon_msg "Stopping $DESC"
30         do_stop
31         log_end_msg $?
32         ;;
33   restart|force-reload)
34         log_daemon_msg "Restarting $DESC"
35         do_stop
36         sleep 1
37         do_start
38         log_end_msg $?
39         ;;
40   *)
41         log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
42         exit 1
43         ;;
44 esac
45
46 exit 0