#!/bin/ash
# bluetooth daemon
# Description: Provides bluetooth functionality.
#

case "$1" in
	start|restart)
		$0 stop
		sleep 1	
		bluetoothd
		sleep 1
		rfcomm bind all
		;;

	stop)
		pidof bluetoothd > /dev/null && rfcomm release all
		while pidof bluetoothd > /dev/null; do killall bluetoothd 2>/dev/null; done
		;;
			
	status)
		pidof bluetoothd > /dev/null && echo "bluetooth is running." || echo "bluetooth is stopped."
		;;		

esac
