Skip to content
Snippets Groups Projects
Commit 2b6e9176 authored by Jens Glathe's avatar Jens Glathe Committed by Jens Glathe
Browse files

try to down hci0 before accessing it


use case: overwrite the default host address already set. In this case the
bt host is already up but needs the new address.

Signed-off-by: default avatarJens Glathe <jglathe@oldschoolsolutions.biz>
parent 3cd4fc2b
No related branches found
No related tags found
1 merge request!7add parameter for variable prefix, try to down hci0 before accessing it, add parameters for interface names
......@@ -148,6 +148,12 @@ mac_generate() {
mac_bluetooth() {
log "setting Bluetooth MAC to $BT_MAC"
# Check if the Bluetooth interface is up
if hciconfig "$BT_INTERFACE" | grep -q "UP"; then
# Bring the Bluetooth interface down
hciconfig "$BT_INTERFACE" down
fi
# Save current rfkill status, may return a non-zero exit code when blocked
set +e
BT_RFKILL_UNBLOCKED=$(rfkill -n -r -o DEVICE,TYPE,SOFT | grep "bluetooth" | grep "unblocked")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment