#! /bin/sh

# /etc/init.d/gpsd: start and stop the GPS daemon

test -x /usr/sbin/gpsd || exit 0

# Configurable options:

case "$1" in
  start)
        echo -n "Starting GPS server: gpsd"
        start-stop-daemon --start --quiet --pidfile /var/run/gpsd.pid --exec /usr/sbin/gpsd
        echo "."
        ;;
  stop)
        echo -n "Stopping GPS server: gpsd"
        start-stop-daemon --stop --quiet --oknodo --pidfile /var/run/gpsd.pid --exec /usr/sbin/gpsd
        echo "."
        ;;

  *)
        echo "Usage: /etc/init.d/gpsd {start|stop}"
        exit 1
esac

exit 0

