File: //etc/init/bluetoothd.conf
description "Bluez daemon"
author "Advanced Network Team"
# do not start on anything
stop on runlevel [06]
console log
expect fork
respawn
respawn limit 5 10
pre-start script
/bin/date
echo "start bluetoothd"
end script
exec /usr/sbin/bluetoothd
post-start script
echo "going to start btacd"
/usr/syno/sbin/synoservicectl --start btacd
end script
pre-stop script
/usr/syno/sbin/synoservicectl --stop btacd
end script
post-stop script
counter=`ls -al ${BLUETOOTH_INFO}* | wc -l`
hcitable=`/usr/bin/hciconfig | grep hci | sed 's/\:/ /g' | awk '{print $1}' | sort -u`
if [ ${counter} -eq 0 ]; then
echo "Try to down ${hcitable}"
for hci in ${hcitable}; do
if [ "x${hci}" != "x" ]; then
echo "try to remove ${hci} "
`/usr/bin/hciconfig ${hci} down`
fi
done
fi
end script
# vim:ft=upstart