Forgot to add file
[gregoa/zavai.git] / hooks / gps
1 #!/bin/sh
2 case "$1" in
3         # At the start of zavai
4         status)
5                 if [ `om gps power` = 1 ]
6                 then
7                         echo on
8                 else
9                         echo off
10                 fi
11         ;;
12         # When starting the gps
13         start)
14                 old=`om gps --swap power 1`
15                 if [ $old = 0 ]
16                 then
17                         om gps keep-on-in-suspend 1
18                 fi
19         ;;
20         # When stopping the gps
21         stop)
22                 om gps power 0
23                 om gps keep-on-in-suspend 0
24         ;;
25         *)
26                 echo "Usage: $0 {start|stop|status}." >&2
27                 exit 1
28         ;;
29 esac
30
31 exit 0