Update uv-pro, vr-n76, and th-d74

When the jq (json query) command executes, it returns 0 if there is a .bluetooth.mac node in the json (which there is, and should be). This means we can't use $? to see if there is a value in the node or not. We need to check the value directly.

Verified that this fixes my pairing issues with the BTech UV-Pro. I'm guessing similar issues exist for the other brands of the same radio, but I don't have those to check against.
This commit is contained in:
David Stewart
2025-12-11 16:40:54 -08:00
committed by GitHub
parent e97895ca76
commit 1284ff1825
+1 -1
View File
@@ -147,7 +147,7 @@ case $1 in
p|pair)
MAC=$(cat ${ACTIVE_RADIO} | jq -e -r .bluetooth.mac)
if [ $? -eq 0 ]; then
if [[ "{$MAC}" != "" ]]; then
PAIR_STATUS=$(bluetoothctl info "${MAC}" | grep "Paired:" | awk '{print $2}')
if [ "${PAIR_STATUS}" == "yes" ]; then
echo "Device with MAC ${MAC} is already paired."