summaryrefslogtreecommitdiff
path: root/recipes-navigation/gpsd
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-05-05 16:37:42 -0500
committerJohn Klug <john.klug@multitech.com>2017-06-19 19:14:23 -0500
commit2694d15ac9166791ffb3cff9faf6711a19047fb0 (patch)
tree8a8467f62e7f815a1dbb9ce25befc1d595bec8a0 /recipes-navigation/gpsd
parent9c6078dc40425dcc46aa2202c30fbf5e93487253 (diff)
downloadmeta-mlinux-2694d15ac9166791ffb3cff9faf6711a19047fb0.tar.gz
meta-mlinux-2694d15ac9166791ffb3cff9faf6711a19047fb0.tar.bz2
meta-mlinux-2694d15ac9166791ffb3cff9faf6711a19047fb0.zip
Exit if there is no GPS capability
Diffstat (limited to 'recipes-navigation/gpsd')
-rwxr-xr-xrecipes-navigation/gpsd/gpsd/gpsd4
1 files changed, 4 insertions, 0 deletions
diff --git a/recipes-navigation/gpsd/gpsd/gpsd b/recipes-navigation/gpsd/gpsd/gpsd
index ed86ecf..fcee788 100755
--- a/recipes-navigation/gpsd/gpsd/gpsd
+++ b/recipes-navigation/gpsd/gpsd/gpsd
@@ -28,10 +28,14 @@ NAME=gpsd
DAEMON=/usr/sbin/$NAME
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
+CAPABILITY=/sys/devices/platform/mts-io/capability/gps
# Read configuration, if present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
+# Exit if we have no GPS capability
+( [[ -f $CAPABILITY ]] && (($(cat $CAPABILITY) == 1)) ) || exit 0
+
# Exit if no gps found
([[ -n $GPS_LINE ]] && [[ -c $GPS_LINE ]]) || exit 0