#!/bin/sh case "$1" in # At the start of zavai status) if [ `om gps power` = 1 ] then if [ `pgrep -c gpsd` != 0 ] then echo on else echo off fi else echo off fi ;; # When starting the gps start) old=`om gps --swap power 1` if [ $old = 0 ] then om gps keep-on-in-suspend 1 /etc/init.d/gpsd stop # TODO: configure to UBX mode /etc/init.d/gpsd start fi ;; # When stopping the gps stop) /etc/init.d/gpsd stop om gps power 0 ;; *) echo "Usage: $0 {start|stop|status}." >&2 exit 1 ;; esac exit 0