|
Lines 136-148
Link Here
|
| 136 |
fi |
136 |
fi |
| 137 |
|
137 |
|
| 138 |
# Add plugins |
138 |
# Add plugins |
| 139 |
local haspppoa=false haspppoe=false plugins="$(_get_array "plugins_${IFVAR}")" |
139 |
local bluetooth=false haspppoa=false haspppoe=false plugins="$(_get_array "plugins_${IFVAR}")" |
| 140 |
local IFS="$__IFS" |
140 |
local IFS="$__IFS" |
| 141 |
for i in ${plugins}; do |
141 |
for i in ${plugins}; do |
| 142 |
unset IFS |
142 |
unset IFS |
| 143 |
set -- ${i} |
143 |
set -- ${i} |
| 144 |
case "$1" in |
144 |
case "$1" in |
| 145 |
passwordfd) continue;; |
145 |
passwordfd) continue;; |
|
|
146 |
bluetooth) bluetooth=true; continue;; |
| 146 |
pppoa) shift; set -- "pppoatm" "$@";; |
147 |
pppoa) shift; set -- "pppoatm" "$@";; |
| 147 |
pppoe) shift; set -- "rp-pppoe" "$@";; |
148 |
pppoe) shift; set -- "rp-pppoe" "$@";; |
| 148 |
capi) shift; set -- "capiplugin" "$@";; |
149 |
capi) shift; set -- "capiplugin" "$@";; |
|
Lines 193-198
Link Here
|
| 193 |
fi |
194 |
fi |
| 194 |
|
195 |
|
| 195 |
fi |
196 |
fi |
|
|
197 |
|
| 198 |
if ${bluetooth}; then |
| 199 |
if [ ! -f /sys/class/bluetooth/rfcomm ]; then |
| 200 |
# Load the rfcomm kernel module |
| 201 |
if ! modprobe rfcomm; then |
| 202 |
eerror "kernel does not support rfcomm" |
| 203 |
return 1 |
| 204 |
fi |
| 205 |
fi |
| 206 |
|
| 207 |
if [ ! -x "$(which sdptool)" ]; then |
| 208 |
# Bluetooth tools are unavailble |
| 209 |
if ! modprobe rfcomm; then |
| 210 |
eerror "system does not have net-wireless/bluez-utils installed" |
| 211 |
return 1 |
| 212 |
fi |
| 213 |
fi |
| 214 |
|
| 215 |
local channel hci_if= rfcomm_dev= |
| 216 |
eval hci_if=\$hci_${IFVAR} |
| 217 |
eval rfcomm_dev=\$rfcomm_${IFVAR} |
| 218 |
[ -n "${hci_if}" ] || hci_if="hci0" |
| 219 |
[ -n "${rfcomm_dev}" ] || rfcomm_dev="rfcomm$(( ${IFVAR#ppp} + 7 ))" |
| 220 |
if [ "${link}" != "/dev/null" ]; then |
| 221 |
channel=$(sdptool search --bdaddr "${link}" DUN | |
| 222 |
egrep Channel | |
| 223 |
cut -d: -f2) |
| 224 |
if [ -z ${channel} ]; then |
| 225 |
eerror "failed to locate bluetooth DUN service on ${link}" |
| 226 |
return 1 |
| 227 |
fi |
| 228 |
if [ -c /dev/${rfcomm_dev} ]; then |
| 229 |
rfcomm -i "${hci_if}" release "${rfcomm_dev}" |
| 230 |
fi |
| 231 |
if ! ( rfcomm -i "${hci_if}" bind "${rfcomm_dev}" "${link}" "$channel" ); then |
| 232 |
eerror "failed to bind rfcomm device ${rfcomm_dev} to ${link} channel ${channel}" |
| 233 |
return 1 |
| 234 |
fi |
| 235 |
link="/dev/${rfcomm_dev}" |
| 236 |
else |
| 237 |
ewarn "WARNING: A BD Address was expected in link_${IFVAR}" |
| 238 |
fi |
| 239 |
|
| 240 |
fi |
| 196 |
[ "${insert_link_in_opts}" = "0" ] || opts="${link} ${opts}" |
241 |
[ "${insert_link_in_opts}" = "0" ] || opts="${link} ${opts}" |
| 197 |
|
242 |
|
| 198 |
ebegin "Starting pppd in ${IFACE}" |
243 |
ebegin "Starting pppd in ${IFACE}" |