#!/bin/sh
### BEGIN INIT INFO
# Provides:          gpsd
# Required-Start:    $remote_fs $syslog $network
# Should-Start:      bluetooth dbus udev
# Required-Stop:     $remote_fs $syslog $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# X-Start-Before:    ntp
# Short-Description: GPS (Global Positioning System) daemon 
# Description:       The gpsd service daemon is able to monitor one or
#                    more GPS devices connected to a host computer, making
#                    all data on the location and movements of the sensors
#                    available to be queried on TCP port 2947.
### END INIT INFO

# Author: Bernd Zeimetz <bzed@debian.org>
#
# Please remove the "Author" lines above and replace them
# with your own name if you copy and modify this script.

#cd ~/programy/usbsoftrock
#./usbsoftrock -s 10 calibrate
#./usbsoftrock -m 2 set freq 20.000

PATH=/sbin:/bin

. /lib/lsb/init-functions

freq=142.997918

case "$1" in
  start)
        "usbsoftrock -m 2 set freq $freq"
        ;;
  restart|reload|force-reload)
        echo "Re-tunning the local oscilator" >&2
        "usbsoftrock -m 2 set freq 20.000"
        wait 1
        "usbsoftrock -m 2 set freq $freq"
        exit 3
        ;;
  stop)
        # No-op
        ;;
  *)
        echo "Error: argument '$1' not supported" >&2
        echo "Usage: $0 start|stop" >&2
        exit 3
        ;;
esac