diff options
author | John Klug <john.klug@multitech.com> | 2017-09-06 17:15:45 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2017-09-06 17:15:45 -0500 |
commit | 389df9a30409d0b0089aa6ba3720a81ca5b6b5df (patch) | |
tree | 856a16489075c162ba9f6a6244297eb394c25636 /recipes-connectivity/bluez/bluez5/init | |
parent | 8028e0dd5163faec8d43886a40adbe29dcfe1477 (diff) | |
download | meta-mlinux-389df9a30409d0b0089aa6ba3720a81ca5b6b5df.tar.gz meta-mlinux-389df9a30409d0b0089aa6ba3720a81ca5b6b5df.tar.bz2 meta-mlinux-389df9a30409d0b0089aa6ba3720a81ca5b6b5df.zip |
Add default and init script to bluez5
Diffstat (limited to 'recipes-connectivity/bluez/bluez5/init')
-rw-r--r-- | recipes-connectivity/bluez/bluez5/init | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/recipes-connectivity/bluez/bluez5/init b/recipes-connectivity/bluez/bluez5/init new file mode 100644 index 0000000..033e24d --- /dev/null +++ b/recipes-connectivity/bluez/bluez5/init @@ -0,0 +1,68 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC=bluetooth + +DAEMON=@LIBEXECDIR@/bluetooth/bluetoothd + +# If you want to be ignore error of "org.freedesktop.hostname1", +# please enable NOPLUGIN_OPTION. +# NOPLUGIN_OPTION="--noplugin=hostname" +NOPLUGIN_OPTION="" +SSD_OPTIONS="--oknodo --quiet --exec $DAEMON -- $NOPLUGIN_OPTION" + +test -f $DAEMON || exit 0 + +# FIXME: any of the sourced files may fail if/with syntax errors +test -f /etc/default/bluetooth && . /etc/default/bluetooth +test -f /etc/default/rcS && . /etc/default/rcS + +set -e + +case $1 in + start) + echo "Starting $DESC" + + if test "$BLUETOOTH_ENABLED" = 0; then + echo "disabled. see /etc/default/bluetooth" + exit 0 + fi + + start-stop-daemon --start --background $SSD_OPTIONS $MOREOPTIONS + echo "${DAEMON##*/}" + + ;; + stop) + echo "Stopping $DESC" + if test "$BLUETOOTH_ENABLED" = 0; then + echo "disabled." + exit 0 + fi + start-stop-daemon --stop $SSD_OPTIONS + echo "${DAEMON}" + ;; + restart|force-reload) + $0 stop + sleep 1 + $0 start + ;; + status) + pidof ${DAEMON} >/dev/null + status=$? + if [ $status -eq 0 ]; then + echo "bluetooth is running." + else + echo "bluetooth is not running" + fi + exit $status + ;; + *) + N=/etc/init.d/bluetooth + echo "Usage: $N {start|stop|restart|force-reload|status}" >&2 + exit 1 + ;; +esac + +exit 0 + +# vim:noet |