summaryrefslogtreecommitdiff
path: root/scripts/connman.in
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/connman.in')
-rw-r--r--scripts/connman.in49
1 files changed, 49 insertions, 0 deletions
diff --git a/scripts/connman.in b/scripts/connman.in
new file mode 100644
index 00000000..a67f6673
--- /dev/null
+++ b/scripts/connman.in
@@ -0,0 +1,49 @@
+#!/bin/sh
+
+DAEMON=@prefix@/sbin/connmand
+PIDFILE=@localstatedir@/run/connmand.pid
+DESC="Connection Manager"
+
+. /lib/lsb/init-functions
+
+if [ -f @sysconfdir@/default/connman ] ; then
+ . @sysconfdir@/default/connman
+fi
+
+set -e
+
+do_start() {
+ start-stop-daemon --start --oknodo \
+ --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_OPTS
+}
+
+do_stop() {
+ start-stop-daemon --stop --oknodo --quiet \
+ --pidfile $PIDFILE --exec $DAEMON
+}
+
+case "$1" in
+ start)
+ log_daemon_msg "Starting $DESC"
+ do_start
+ log_end_msg $?
+ ;;
+ stop)
+ log_daemon_msg "Stopping $DESC"
+ do_stop
+ log_end_msg $?
+ ;;
+ restart|force-reload)
+ log_daemon_msg "Restarting $DESC"
+ do_stop
+ sleep 1
+ do_start
+ log_end_msg $?
+ ;;
+ *)
+ log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
+ exit 1
+ ;;
+esac
+
+exit 0