Skip to content

Commit

Permalink
Improved rfkill check
Browse files Browse the repository at this point in the history
  • Loading branch information
peos3 committed Jun 20, 2018
1 parent 1c32b4c commit 6ea22e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bt_save.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/sh
bt_state=$(rfkill list | grep Bluetooth -m 1 -A1 | grep "Soft blocked" | sed 's/^.*: //')
# Get first line after column header
bt_state=$(rfkill list bluetooth -o SOFT | head -2 | tail -1)

if [ "$bt_state" = "no" ]; then
if [ "$bt_state" = "unblocked" ]; then
echo "1" > bt_state
else
echo "0" > bt_state
Expand Down

0 comments on commit 6ea22e9

Please sign in to comment.