#!/bin/sh
########################################################################
# Begin bluetooth
#
# Description : BlueZ Boot Script
#
# Authors     : Armin K. <krejzi@email.com>
#
# Version     : BLFS SVN
#
# Notes       : Configurable through /etc/sysconfig/bluetooth
#
########################################################################

### BEGIN INIT INFO
# Provides:            bluetooth
# Required-Start:      $local_fs $syslog dbus
# Required-Stop:       $local_fs $syslog
# Default-Start:       2 3 4 5
# Default-Stop:        0 1 6
# Short-Description:   Starts bluetooth daemons
# X-LFS-Provided-By:   BLFS
### END INIT INFO

. /lib/lsb/init-functions

case "${1}" in
   start)
      log_info_msg "Starting Bluetooth daemon bluetoothd"
      start_daemon /usr/libexec/bluetooth/bluetoothd
      evaluate_retval
      ;;

   stop)
      log_info_msg "Stopping Bluetooth daemon bluetoothd"
      killproc /usr/libexec/bluetooth/bluetoothd
      evaluate_retval
      ;;

   restart)
      ${0} stop
      sleep 1
      ${0} start
      ;;

   status)
      statusproc /usr/libexec/bluetooth/bluetoothd
      ;;

   *)

      echo "Usage: ${0} {start|stop|restart|status}"
      exit 1

      ;;
esac

exit 0

# End bluetooth
