1 |
#!/bin/sh |
1 |
#!/bin/sh |
2 |
### BEGIN INIT INFO |
2 |
### BEGIN INIT INFO |
3 |
# Provides: gpsd |
3 |
# Provides: setup_lo |
4 |
# Required-Start: $remote_fs $syslog $network |
- |
|
5 |
# Should-Start: bluetooth dbus udev |
- |
|
6 |
# Required-Stop: $remote_fs $syslog $network |
- |
|
7 |
# Default-Start: 2 3 4 5 |
4 |
# Default-Start: 2 3 4 5 |
8 |
# Default-Stop: 0 1 6 |
5 |
# Default-Stop: 0 1 6 |
9 |
# X-Start-Before: ntp |
- |
|
10 |
# Short-Description: GPS (Global Positioning System) daemon |
6 |
# Short-Description: Tune local oscilator |
11 |
# Description: The gpsd service daemon is able to monitor one or |
7 |
# Description: This start-up script tune local oscilator to defined frequency. |
12 |
# more GPS devices connected to a host computer, making |
- |
|
13 |
# all data on the location and movements of the sensors |
- |
|
14 |
# available to be queried on TCP port 2947. |
- |
|
15 |
### END INIT INFO |
8 |
### END INIT INFO |
16 |
|
9 |
|
17 |
# Author: Bernd Zeimetz <bzed@debian.org> |
10 |
# Author: Jakub Kakona <kaklik@mlab.cz> |
18 |
# |
11 |
# |
19 |
# Please remove the "Author" lines above and replace them |
12 |
# Please remove the "Author" lines above and replace them |
20 |
# with your own name if you copy and modify this script. |
13 |
# with your own name if you copy and modify this script. |
21 |
|
14 |
|
22 |
#cd ~/programy/usbsoftrock |
15 |
#cd ~/programy/usbsoftrock |
23 |
#./usbsoftrock -s 10 calibrate |
16 |
#./usbsoftrock -s 10 calibrate |
24 |
#./usbsoftrock -m 2 set freq 20.000 |
17 |
#./usbsoftrock -m 2 set freq 20.000 |
25 |
|
18 |
|
26 |
PATH=/sbin:/bin |
19 |
PATH=/sbin:/bin |
27 |
|
20 |
|
28 |
. /lib/lsb/init-functions |
21 |
. /lib/lsb/init-functions |
29 |
|
22 |
|
30 |
freq=142.997918 |
23 |
freq=142.997918 |
31 |
|
24 |
|
32 |
case "$1" in |
25 |
case "$1" in |
33 |
start) |
26 |
start) |
34 |
"usbsoftrock -m 2 set freq $freq" |
27 |
"usbsoftrock -m 2 set freq $freq" |
35 |
;; |
28 |
;; |
36 |
restart|reload|force-reload) |
29 |
restart|reload|force-reload) |
37 |
echo "Re-tunning the local oscilator" >&2 |
30 |
echo "Re-tunning the local oscilator" >&2 |
38 |
"usbsoftrock -m 2 set freq 20.000" |
31 |
"usbsoftrock -m 2 set freq 20.000" |
39 |
wait 1 |
32 |
wait 1 |
40 |
"usbsoftrock -m 2 set freq $freq" |
33 |
"usbsoftrock -m 2 set freq $freq" |
41 |
exit 3 |
34 |
exit 3 |
42 |
;; |
35 |
;; |
43 |
stop) |
36 |
stop) |
44 |
# No-op |
37 |
# No-op |
45 |
;; |
38 |
;; |
46 |
*) |
39 |
*) |
47 |
echo "Error: argument '$1' not supported" >&2 |
40 |
echo "Error: argument '$1' not supported" >&2 |
48 |
echo "Usage: $0 start|stop" >&2 |
41 |
echo "Usage: $0 start|stop" >&2 |
49 |
exit 3 |
42 |
exit 3 |
50 |
;; |
43 |
;; |
51 |
esac |
44 |
esac |
52 |
|
45 |
|
53 |
|
46 |
|