Rev 3279 Rev 3280
1 #!/bin/sh 1 #!/bin/sh
2 ### BEGIN INIT INFO 2 ### BEGIN INIT INFO
3 # Provides: setup_lo 3 # Provides: setup_lo
4 # Default-Start: 2 3 4 5 4 # Default-Start: 2 3 4 5
5 # Default-Stop: 0 1 6 5 # Default-Stop: 0 1 6
6 # Short-Description: Tune local oscilator 6 # Short-Description: Tune local oscilator
7 # Description: This start-up script tune local oscilator to defined frequency. 7 # Description: This start-up script tune local oscilator to defined frequency.
8 ### END INIT INFO 8 ### END INIT INFO
9   9  
10 # Author: Jakub Kakona <kaklik@mlab.cz> 10 # Author: Jakub Kakona <kaklik@mlab.cz>
11 # 11 #
12 # Please remove the "Author" lines above and replace them 12 # Please remove the "Author" lines above and replace them
13 # with your own name if you copy and modify this script. 13 # with your own name if you copy and modify this script.
14   14  
15 #cd ~/programy/usbsoftrock 15 #cd ~/programy/usbsoftrock
16 #./usbsoftrock -s 10 calibrate 16 #./usbsoftrock -s 10 calibrate
17 #./usbsoftrock -m 2 set freq 20.000 17 #./usbsoftrock -m 2 set freq 20.000
18   18  
19 PATH=/sbin:/bin 19 PATH=/sbin:/bin
20   20  
21 . /lib/lsb/init-functions 21 . /lib/lsb/init-functions
22   22  
23 freq=142.997918 23 freq=142.997918
24   24  
25 case "$1" in 25 case "$1" in
26 start) 26 start|required-start)
27 "usbsoftrock -m 2 set freq $freq" 27 "usbsoftrock -m 2 set freq $freq"
28 ;; 28 ;;
29 restart|reload|force-reload) 29 restart|reload|force-reload)
30 echo "Re-tunning the local oscilator" >&2 30 echo "Re-tunning the local oscilator" >&2
31 "usbsoftrock -m 2 set freq 20.000" 31 "usbsoftrock -m 2 set freq 20.000"
32 wait 1 32 wait 1
33 "usbsoftrock -m 2 set freq $freq" 33 "usbsoftrock -m 2 set freq $freq"
34 exit 3 34 exit 3
35 ;; 35 ;;
36 stop) 36 stop|required-stop)
37 # No-op 37 # No-op
38 ;; 38 ;;
39 *) 39 *)
40 echo "Error: argument '$1' not supported" >&2 40 echo "Error: argument '$1' not supported" >&2
41 echo "Usage: $0 start|stop" >&2 41 echo "Usage: $0 start|stop" >&2
42 exit 3 42 exit 3
43 ;; 43 ;;
44 esac 44 esac
45   45  
46   46