Chinaunix首页 | 论坛 | 博客
  • 博客访问: 261754
  • 博文数量: 89
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 655
  • 用 户 组: 普通用户
  • 注册时间: 2018-10-15 14:13
个人简介

搭建一个和linux开发者知识共享和学习的平台

文章分类

全部博文(89)

文章存档

2024年(2)

2023年(24)

2022年(27)

2019年(8)

2018年(27)

分类: 嵌入式

2018-10-15 15:08:53

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
阅读(2083) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~