#!/bin/bash # $Header: /root/magellan-cvs/src/bluez/bluetoothd.rc,v 1.1 2009-06-12 16:44:12 niro Exp $ #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k #%start: 80 #%stop: 20 #deps #%needs: #%before: #%after: source /etc/conf.d/rc source $rc_functions # read config source /etc/conf.d/bluetoothd case "$1" in start) echo -e ${COLOREDSTAR}"Starting Bluetooth ..." echo -e ${COLOREDSTAR}" Starting bluetoothd ..." # -s enables internal sdp server start-stop-daemon --start --exec /usr/sbin/bluetoothd evaluate_retval if [[ ${HID2HCI_ENABLE} = true ]] && [ -x /usr/sbin/hid2hci ] then echo -e ${COLOREDSTAR}" Running hid2hci ..." /usr/sbin/hid2hci --tohci -q # be quiet here evaluate_retval fi if [[ ${RFCOMM_ENABLE} = true ]] && [ -x /usr/bin/rfcomm ] then if [ -f "${RFCOMM_CONFIG}" ] then echo -e ${COLOREDSTAR}" Starting rfcomm ..." /usr/bin/rfcomm -f "${RFCOMM_CONFIG}" bind all evaluate_retval else ${WARNING} echo "Not enabling rfcomm because RFCOMM_CONFIG does not exists" ${NORMAL} fi fi update_svcstatus $1 splash svc_started "$(basename $0)" 0 ;; stop) echo -e ${COLOREDSTAR}"Stopping Bluetooth ..." start-stop-daemon --stop --quiet --exec /usr/sbin/bluetoothd evaluate_retval update_svcstatus $1 splash svc_stopped "$(basename $0)" 0 ;; restart) $0 stop sleep 1 $0 start ;; status) statusproc /usr/sbin/bluetoothd ;; *) echo "Usage: $0 {start|stop|restart|status}" exit 1 ;; esac