QtMoko navit wrapper script, clock stays on

Peter Fey fey.peter at googlemail.com
Mon Aug 20 19:10:14 CEST 2012


Hi Patryk,

it works. Thanks a lot
Peter

Am 20.08.2012 08:56, schrieb Patryk Benderz:
> #!/bin/sh
> /opt/qtmoko/bin/gps-poweron.sh
> +/opt/qtmoko/bin/checknavitgpsoff.sh&
>> /opt/qtmoko/bin/navit.bin&
> ...and additionally have something like this (checknavitgpsoff.sh)
> running in background:
> #!/bin/sh
> #
> # Defining variables:
> logfile=/var/log/checknavitgpsoff.log
> sleeptime=10
> # Initial sleep, to let Navit start:
> sleep ${sleeptime}
> # Loop search for Navit process:
> while
> do
>    ps ax|grep -v 'grep'|grep 'navit'
>    if (($?==0))
>    then
>      echo `date +"%F %X"`": Navit still running...">>  ${logfile}
>      sleep ${sleeptime}
>    else
>      echo `date +"%F %X"`": Unable to find Navit PID. Turning off GPS.">>  ${logfile}
>      /opt/qtmoko/bin/gps-poweroff.sh
>      break
>      # or 'exit 0' instead of break
>    fi
> done
>




More information about the community mailing list