Ver Fonte

'check_gps' hinzufügen

Daniel Wenzel há 3 anos atrás
pai
commit
3257576c8a
1 ficheiros alterados com 16 adições e 0 exclusões
  1. 16 0
      check_gps

+ 16 - 0
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