]> ToastFreeware Gitweb - gregoa/zavai.git/commitdiff
Added Bluetooth hook
authorEnrico Zini <enrico@enricozini.org>
Tue, 9 Mar 2010 22:24:30 +0000 (23:24 +0100)
committerEnrico Zini <enrico@enricozini.org>
Tue, 9 Mar 2010 22:24:30 +0000 (23:24 +0100)
hooks/bluetooth [new file with mode: 0755]

diff --git a/hooks/bluetooth b/hooks/bluetooth
new file mode 100755 (executable)
index 0000000..fd404d2
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+case "$1" in
+       # At the start of zavai
+       status)
+               if [ "`om bt power`" = 1 ]
+               then
+                       echo on
+               else
+                       echo off
+               fi
+       ;;
+       # When starting bluetooth
+       start)
+               om bt power 1
+       ;;
+       # When stopping bluetooth
+       stop)
+               om bt power 0
+       ;;
+       *)
+               echo "Usage: $0 {start|stop|status}." >&2
+               exit 1
+       ;;
+esac
+
+exit 0