ntnu-b2xx: fs/etc/rc.d/rtklib_single: New service for single position GPS using rtklib.

This commit is contained in:
Kristian Klausen 2016-02-12 17:43:47 +01:00
parent e4127668e3
commit 70063de02f

View File

@ -0,0 +1,27 @@
start()
{
(cd /opt/lsts/rtklib/ && exec rtkrcv -s -o /etc/rtklib/conf/rtkrcv_single.conf -d /tmp/ttyC0 < /dev/null > /opt/lsts/rtklib/startlog.log 2>&1 &)
}
stop()
{
while [ 1 ]; do
echo "* Stopping process..."
killall rtkrcv > /dev/null 2>&1
for r in 0 1 2 3 4 5 6 7 8 9; do
if [ -n "$(pidof rtkrcv)" ]; then
echo "* Waiting for process to exit ($r)..."
sleep 1
else
echo "* Process not running."
return 1
fi
done
echo "* Forcing exit..."
killall -9 rtkrcv > /dev/null 2>&1
sleep 1
done
}