1 #!/bin/sh /etc/rc.common
2 # Copyright (C) 2007 OpenWrt.org
12 config_get_bool _val "$section" "$option" '0'
13 [ "$_val" -gt 0 ] && append args "$3"
22 config_get _val "$section" "$option" "$default"
23 [ -n "$_val" ] && append args "$3 $_val"
29 append_bool "$cfg" nodaemon "-n"
30 append_string "$cfg" config "-f"
31 config_get_bool enabled "$cfg" "enabled" '1'
32 [ "$enabled" -gt 0 ] && /usr/sbin/hcid $args
38 append_string "$cfg" initspeed "-s" "115200"
39 append_string "$cfg" tty " " "ttyS1"
40 append_string "$cfg" type " " "csr"
41 append_string "$cfg" speed " " "115200"
42 append_string "$cfg" flow " " "noflow"
43 config_get_bool enabled "$cfg" "enabled" '1'
44 [ "$enabled" -gt 0 ] && /usr/sbin/hciattach $args
50 append_string "$cfg" config "-f"
51 config_get_bool enabled "$cfg" "enabled" '1'
52 [ "$enabled" -gt 0 ] && /usr/bin/rfcomm $args bind all
58 append_bool "$cfg" listen "--listen"
59 append_string "$cfg" connect "--connect"
60 append_string "$cfg" mrouter "--mrouter"
61 append_bool "$cfg" search "--search"
62 append_string "$cfg" channel "--channel"
63 append_string "$cfg" device "--device"
64 append_bool "$cfg" nosdp "--nosdp"
65 append_bool "$cfg" auth "--auth"
66 append_bool "$cfg" encrypt "--encrypt"
67 append_bool "$cfg" secure "--secure"
68 append_bool "$cfg" master "--master"
69 append_bool "$cfg" nodetach "--nodetach"
70 append_bool "$cfg" persist "--persist"
71 append_string "$cfg" pppd "--pppd"
72 append_bool "$cfg" msdun "--msdun"
73 append_bool "$cfg" activesync "--activesync"
74 append_bool "$cfg" cache "--cache"
76 append_string "$cfg" pppdopts ""
77 config_get ifn "$cfg" interface
78 if [ -n "$ifn" ]; then
79 config_get unit "$cfg" unit
80 [ -z "$unit" ] || append args "unit $unit ipparam $ifn linkname $ifn"
83 config_get_bool enabled "$cfg" "enabled" '1'
84 [ "$enabled" -gt 0 ] && /usr/bin/dund $args
90 append_bool "$cfg" listen "--listen"
91 append_string "$cfg" connect "--connect"
92 append_bool "$cfg" autozap "--autozap"
93 append_bool "$cfg" search "--search"
94 append_string "$cfg" role "--role"
95 append_string "$cfg" service "--service"
96 append_string "$cfg" ethernet "--ethernet"
97 append_string "$cfg" device "--device"
98 append_bool "$cfg" nosdp "-D"
99 append_bool "$cfg" auth "-A"
100 append_bool "$cfg" encrypt "-E"
101 append_bool "$cfg" secure "-S"
102 append_bool "$cfg" master "-M"
103 append_bool "$cfg" nodetach "-n"
104 append_bool "$cfg" persist "--persist"
105 append_bool "$cfg" cache "--cache"
106 append_string "$cfg" pidfile "--pidfile"
107 config_get_bool enabled "$cfg" "enabled" '1'
108 [ "$enabled" -gt 0 ] && /usr/bin/pand $args
114 config_load bluetooth
116 config_foreach hcid_config hcid
117 config_foreach hciattach_config hciattach
118 config_foreach rfcomm_config rfcomm
119 config_foreach dund_config dund
120 config_foreach pand_config pand
126 /usr/bin/rfcomm release all