fix scanning for devices broke pairing
This commit is contained in:
parent
f2d69e7759
commit
0edc5b51fb
5
bt
5
bt
@ -28,7 +28,9 @@ power(){
|
||||
}
|
||||
scan(){
|
||||
scanstatus="$( bluetoothctl show | grep Discovering | awk '{print $2}' )"
|
||||
if [ "$1" = on ]; then
|
||||
if [ "$1" = "on" ]; then
|
||||
#sets variable in case scanning was already on before the start of bt
|
||||
[ "$start_scan" = "" ] && start_scan="$( date +'%s' )"
|
||||
if [ "$scanstatus" = "no" ]; then
|
||||
bluetoothctl scan on &
|
||||
start_scan="$( date +'%s' )"
|
||||
@ -36,7 +38,6 @@ scan(){
|
||||
elif [ "$1" = off ]; then
|
||||
if [ "$scanstatus" = "yes" ]; then
|
||||
bluetoothctl scan off
|
||||
start_scan="$( date +'%s' )"
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user