RTL8723BU wifi和蓝牙二合一芯片启动脚本

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

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值