Files
check_gps/check_gps
2022-02-18 15:00:29 +01:00

16 lines
310 B
Bash

#!/bin/bash
RetVal=3
Modus=$(/usr/bin/gpspipe -w -n 10 | jq -r ".mode" | grep "[[:digit:]]" | tail -1)
if [ "$Modus" == "3" ] ; then
echo "OK: GPS 3D-Fix"
RetVal=0
elif [ "$Modus" == "2" ] ; then
echo "Warning: 2D-Fix"
RetVal=1
else
echo "Error: No fix or Status unknown"
RetVal=2
fi
exit $RetVal