Line 0
Link Here
|
|
|
1 |
#!/bin/sh |
2 |
# |
3 |
# $FreeBSD$ |
4 |
# |
5 |
|
6 |
# PROVIDE: gpsd |
7 |
# REQUIRE: NETWORKING DAEMON cleanvar devfs |
8 |
# BEFORE: ntpd |
9 |
# KEYWORD: shutdown |
10 |
|
11 |
# |
12 |
# Add the following lines to /etc/rc.conf to enable gpsd: |
13 |
# |
14 |
# gpsd_enable (bool): Set to "NO" by default. |
15 |
# Set it to "YES" to enable gpsd. |
16 |
# |
17 |
# gpsd_flags (str): Set to "" by default. |
18 |
# See gpsd(8) for flags. |
19 |
# |
20 |
# gpsd_devices (str): Set to "" by default. |
21 |
# Example: "/dev/cuaU0" for a USB serial GPS. |
22 |
# |
23 |
|
24 |
. %%RC_SUBR%% |
25 |
|
26 |
name=gpsd |
27 |
rcvar=`set_rcvar` |
28 |
|
29 |
load_rc_config $name |
30 |
|
31 |
# Set defaults |
32 |
: ${gpsd_enable:="NO"} |
33 |
: ${gpsd_flags:=""} |
34 |
: ${gpsd_devices:=""} |
35 |
|
36 |
pidfile=/var/run/$name.pid |
37 |
command=%%PREFIX%%/sbin/$name |
38 |
command_args="-P $pidfile $gpsd_devices" |
39 |
|
40 |
run_rc_command "$1" |