Annotation of /trunk/bluez/bluetoothd.rc
Parent Directory | Revision Log
Revision 846 -
(hide annotations)
(download)
Fri Jun 12 16:44:12 2009 UTC (15 years, 4 months ago) by niro
File size: 1514 byte(s)
Fri Jun 12 16:44:12 2009 UTC (15 years, 4 months ago) by niro
File size: 1514 byte(s)
-files and patches for bluez pkg
1 | niro | 846 | #!/bin/bash |
2 | # $Header: /root/magellan-cvs/src/bluez/bluetoothd.rc,v 1.1 2009-06-12 16:44:12 niro Exp $ | ||
3 | |||
4 | #%rlevels: 3:s 4:s 5:s 0:k 1:k 2:k 6:k | ||
5 | #%start: 80 | ||
6 | #%stop: 20 | ||
7 | |||
8 | #deps | ||
9 | #%needs: | ||
10 | #%before: | ||
11 | #%after: | ||
12 | |||
13 | source /etc/conf.d/rc | ||
14 | source $rc_functions | ||
15 | |||
16 | # read config | ||
17 | source /etc/conf.d/bluetoothd | ||
18 | |||
19 | case "$1" in | ||
20 | start) | ||
21 | echo -e ${COLOREDSTAR}"Starting Bluetooth ..." | ||
22 | |||
23 | echo -e ${COLOREDSTAR}" Starting bluetoothd ..." | ||
24 | # -s enables internal sdp server | ||
25 | start-stop-daemon --start --exec /usr/sbin/bluetoothd | ||
26 | evaluate_retval | ||
27 | |||
28 | if [[ ${HID2HCI_ENABLE} = true ]] && [ -x /usr/sbin/hid2hci ] | ||
29 | then | ||
30 | echo -e ${COLOREDSTAR}" Running hid2hci ..." | ||
31 | /usr/sbin/hid2hci --tohci -q # be quiet here | ||
32 | evaluate_retval | ||
33 | fi | ||
34 | |||
35 | if [[ ${RFCOMM_ENABLE} = true ]] && [ -x /usr/bin/rfcomm ] | ||
36 | then | ||
37 | if [ -f "${RFCOMM_CONFIG}" ] | ||
38 | then | ||
39 | echo -e ${COLOREDSTAR}" Starting rfcomm ..." | ||
40 | /usr/bin/rfcomm -f "${RFCOMM_CONFIG}" bind all | ||
41 | evaluate_retval | ||
42 | else | ||
43 | ${WARNING} | ||
44 | echo "Not enabling rfcomm because RFCOMM_CONFIG does not exists" | ||
45 | ${NORMAL} | ||
46 | fi | ||
47 | fi | ||
48 | |||
49 | update_svcstatus $1 | ||
50 | splash svc_started "$(basename $0)" 0 | ||
51 | ;; | ||
52 | |||
53 | stop) | ||
54 | echo -e ${COLOREDSTAR}"Stopping Bluetooth ..." | ||
55 | start-stop-daemon --stop --quiet --exec /usr/sbin/bluetoothd | ||
56 | evaluate_retval | ||
57 | |||
58 | update_svcstatus $1 | ||
59 | splash svc_stopped "$(basename $0)" 0 | ||
60 | ;; | ||
61 | |||
62 | |||
63 | restart) | ||
64 | $0 stop | ||
65 | sleep 1 | ||
66 | $0 start | ||
67 | ;; | ||
68 | |||
69 | status) | ||
70 | statusproc /usr/sbin/bluetoothd | ||
71 | ;; | ||
72 | |||
73 | *) | ||
74 | echo "Usage: $0 {start|stop|restart|status}" | ||
75 | exit 1 | ||
76 | ;; | ||
77 | esac |