From f984aa7548ae568af3095e1a84ec2f32bb466ca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=85=89-k?= <36470587+kxgx@users.noreply.github.com> Date: Fri, 10 Jan 2025 00:52:56 +0800 Subject: [PATCH] Update btwifi.sh --- bin/btwifi.sh | 56 ++++++++++++++++++++------------------------------- 1 file changed, 22 insertions(+), 34 deletions(-) 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 <