#!/bin/sh # # # # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/libexec GPSD_HELPER=/usr/libexec/navicore-gpsd-helper GPSD_DAEMON=/usr/sbin/gpsd DSMETOOL=/usr/bin/dsmetool USE_DSMETOOL=no # abort if no executable exists test -x $GPS_HELPER || exit 0 case "$1" in start) if [ -e /sys/devices/platform/gpio-switch/gps_reset/state ]; then echo "Starting navicore gpsd helper" if [ x"$USE_DSMETOOL" = x"no" ]; then start-stop-daemon --start --quiet -b --exec $GPSD_HELPER else $DSMETOOL -t $GPS_DAEMON fi fi ;; stop) if [ -e /sys/devices/platform/gpio-switch/gps_reset/state ]; then echo "Stoping navicore gpsd helper" if [ x"$USE_DSMETOOL" = x"no" ]; then start-stop-daemon --stop --quiet --oknodo --exec $GPSD_HELPER # start-stop-daemon --stop --quiet --oknodo --exec $GPSD_DAEMON else $DSMETOOL -k $GPS_DAEMON fi fi ;; restart|force-reload) $0 stop $0 start ;; *) echo "Usage: $0 {start|stop}" exit 1 ;; esac