I am trying to get a gpxlogger running after booting up RaspPi, the problem is that gpxlogger automatically shuts down after 5 seconds if there is no signal from GPSD on startup (which gets the signal around 1,5-2 minutes after boot, sometimes more so sleep would probably not solve it), and if that happens, it returns with a 0.
So far I've got:
(while true; do
until gpxlogger -d -f /home/pi/gpslogs/log'%Y-%m-%d-%H:%M:%S'.txt -i 2; do
echo "restarting"
sleep 10
done
done
) &
in /etc/init.d/rc.local
The problem is, the script doesn't wait for the gpxlogger to return, but starts a new gpxlogger every 10 seconds.
tl;dr Desired action:
Start up Raspberry -> Loop gpxloggers dying after 5 seconds of no data from GPSD -> Get fix in GPSD -> Single gpxlogger keeps logging into file
Could someone try to help me with this? Any input would be appreciated.