diff options
author | Christopher Larson <chris_larson@mentor.com> | 2015-11-10 21:24:58 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-11-25 08:07:54 +0000 |
commit | f4c16f53af27ad459e77ae7f43e7bf1bad70645a (patch) | |
tree | d07591398bb24b00135f39fcc75c2319ba8eca46 /meta/recipes-connectivity/bluez5/bluez5 | |
parent | 191a1817c9dce90f3094bc98d6e0f5ab02f8a5c7 (diff) | |
download | openembedded-core-f4c16f53af27ad459e77ae7f43e7bf1bad70645a.tar.gz |
bluez5: enable sysvinit support
This is from Shrikant Bobade <Shrikant_Bobade@mentor.com>.
Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/recipes-connectivity/bluez5/bluez5')
-rw-r--r-- | meta/recipes-connectivity/bluez5/bluez5/init | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/bluez5/bluez5/init b/meta/recipes-connectivity/bluez5/bluez5/init new file mode 100644 index 0000000000..1606a5c663 --- /dev/null +++ b/meta/recipes-connectivity/bluez5/bluez5/init @@ -0,0 +1,68 @@ +#!/bin/sh + +PATH=/sbin:/bin:/usr/sbin:/usr/bin +DESC=bluetooth + +DAEMON=/usr/lib/bluez5/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 + 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 |