]> git.donarmstrong.com Git - bin.git/commitdiff
add toggle_rfkill
authorDon Armstrong <don@donarmstrong.com>
Tue, 30 Aug 2016 10:56:01 +0000 (03:56 -0700)
committerDon Armstrong <don@donarmstrong.com>
Tue, 30 Aug 2016 10:56:01 +0000 (03:56 -0700)
toggle_rfkill [new file with mode: 0755]

diff --git a/toggle_rfkill b/toggle_rfkill
new file mode 100755 (executable)
index 0000000..d914dd3
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if /usr/sbin/rfkill list|grep -q 'blocked yes' ; then
+    # for some reason, a single call of unblock all isn't sufficient
+    # to turn back on bluetooth
+    /usr/sbin/rfkill unblock all;
+    /usr/sbin/rfkill unblock all;
+else
+    /usr/sbin/rfkill block all;
+fi;