diff --git a/bin/btwifi.sh b/bin/btwifi.sh index 61cfa52..b86945b 100644 --- a/bin/btwifi.sh +++ b/bin/btwifi.sh @@ -6,26 +6,10 @@ if [ "$EUID" -ne 0 ]; then exit 1 fi -# 蓝牙适配器名称 -BLUETOOTH_ADAPTER="hci0" -# 蓝牙网络共享服务名称 -BLUETOOTH_SERVICE="nap" -# 蓝牙网络共享服务的名称 -BLUETOOTH_NAP_NAME="RaspberryPiNetwork" -# 蓝牙网络共享服务的PIN码 -BLUETOOTH_PIN="1234" -# 蓝牙网络共享的IP地址范围 -BLUETOOTH_IP_RANGE="192.168.44.1/24" -# 蓝牙网络共享的DHCP范围 -BLUETOOTH_DHCP_RANGE="192.168.44.10,192.168.44.50" - # 启动蓝牙服务 systemctl start bluetooth -# 设置蓝牙设备名称(使用 hciconfig 而不是 bluetoothctl) -hciconfig $BLUETOOTH_ADAPTER name $BLUETOOTH_NAP_NAME - -# 设置蓝牙设备可发现和可配对 +# 使用 bluetoothctl 设置蓝牙 bluetoothctl < /etc/rfcomm.conf < /etc/bluetooth/rfcomm.conf < /etc/dhcpcd.conf < /etc/iptables.ipv4.nat @@ -75,4 +60,7 @@ cat >> /etc/rc.local <