echo "${GREEN}Start WiFi Service ...${NORMAL}"
modprobe cfg80211
modprobe 8723bu
sleep 5
ifconfig wlan0 192.168.3.50 up
if [ $? = "0" ] ;then
mv /dev/random /dev/random.org
ln -s /dev/urandom /dev/random
/dvs/hostapd -B /etc/hostapd.conf&
mkdir -p /var/lib/misc/
echo "">/var/lib/misc/udhcpd.leases
udhcpd /etc/udhcpd.conf&
else
echo "ifconfig wlan0 up failed !"
fi
echo "${GREEN}Start BlueTooth Service ...${NORMAL}"
modprobe rtk_btusb
sleep 5
if ( [ -r /sys/class/bluetooth/hci0 ] ) ;
then
rfkill list
rfkill block bluetooth
rfkill unblock bluetooth
rfkill unblock bluetooth
for i in 1 2 3 4 5 6 7 8 9 10
do
sleep 1
echo "hciconfig hci0 up"
hciconfig hci0 up
if [ $? = "0" ] ;then
break
fi
rmmod rtk_btusb
modprobe rtk_btusb
done
hciconfig hci0 up
if [ $? = "0" ] ;then
hciconfig hci0 iscan
hciconfig hci0 piscan
rm /opt/arm/bluez/var/run/dbus/pid
dbus-daemon --system
hcid -f /opt/arm/bluez/etc/bluetooth/hcid.conf -n&
else
rmmod rtk_btusb
modprobe rtk_btusb
sleep 5
for i in 1 2 3 4 5 6 7 8 9 10
do
sleep 1
echo "hciconfig hci0 up"
hciconfig hci0 up
if [ $? = "0" ] ;then
break
fi
rmmod rtk_btusb
modprobe rtk_btusb
done
hciconfig hci0 up
if [ $? = "0" ] ;then
hciconfig hci0 iscan
hciconfig hci0 piscan
rm /opt/arm/bluez/var/run/dbus/pid
dbus-daemon --system
hcid -f /opt/arm/bluez/etc/bluetooth/hcid.conf -n&
else
echo "hciconfig hci0 up failed!"
fi
fi
else
echo "hciconfig failed !"
fi
阅读(2159) | 评论(0) | 转发(0) |