/Designs/Measuring_instruments/RMDS01A/SW/Scripts/setup_lo
14,29 → 14,48
# 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:/usr/local/bin/
PATH=/sbin:/usr/local/bin:/bin:/usr/bin
DESC="Usb softrock local oscillator tunning script"
NAME=usbsoftrock
DAEMON=/usr/sbin/$NAME
DAEMON_ARGS=""
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
 
# Exit if the package is not installed
if [ -x "$DAEMON" ]
then echo "usbsoftrock not installed. Nothing to done"
exit 0
fi
 
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
 
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
 
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
 
 
freq=142.997918
 
case "$1" in
start)
"usbsoftrock -m 2 set freq $freq"
usbsoftrock -m 2 set freq $freq
;;
restart|reload|force-reload)
echo "Re-tunning the local oscilator" >&2
usbsoftrock -m 2 set freq 20.000
usbsoftrock -v -m 2 set freq 20.000
wait 1
usbsoftrock -m 2 set freq $freq
usbsoftrock -v -m 2 set freq $freq
exit 3
;;
stop)
# No-op
echo "Local oscillator is tuned to `usbsoftrock getfreq | grep Frequency` "
;;
*)
echo "Error: argument '$1' not supported" >&2