From 3257576c8a544523793e881da74b1fbf62dcf147 Mon Sep 17 00:00:00 2001 From: Daniel Wenzel Date: Fri, 18 Feb 2022 15:00:29 +0100 Subject: [PATCH] =?UTF-8?q?'check=5Fgps'=20hinzuf=C3=BCgen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- check_gps | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 check_gps diff --git a/check_gps b/check_gps new file mode 100644 index 0000000..498c07e --- /dev/null +++ b/check_gps @@ -0,0 +1,16 @@ +#!/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 \ No newline at end of file