-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgpsdate.init
executable file
·73 lines (53 loc) · 1.42 KB
/
gpsdate.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#!/bin/sh
#/etc/init.d/gpsdate: start gpsdate daemon.
### BEGIN INIT INFO
# Provides: gpsdate
# Short-Description: Start software gpsdate
# Required-Start: $all
# Required-Stop: $all
# Should-Start: gpsd
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
PATH=/bin:/usr/bin:/sbin:/usr/sbin
test -x /usr/sbin/gpsdate || exit 0
# For configuration of the init script use the file
# /etc/default/gpsdate, do not edit this init script.
# Set run_gpsdate to 1 to start gpsdate or 0 to disable it.
# Specify additional gpsdate options here (see manpage).
gpsdate_options=""
# Specify module to load
gpsdate_module="none"
run_gpsdate=1
[ -e /etc/default/gpsdate ] && . /etc/default/gpsdate
NAME=gpsdate
DAEMON=/usr/sbin/gpsdate
case "$1" in
start)
if [ $run_gpsdate = 1 ]
then
# do we have to load a module?
[ ${gpsdate_module:-none} != "none" ] && /sbin/modprobe $gpsdate_module
# Unconditionally start gpsdate daemon because we want to run it even
# if wd_keepalive wasn't running
echo "Starting gpsdate..."
$DAEMON $gpsdate_options
fi
;;
stop)
;;
restart)
$0 force-reload
;;
force-reload)
if [ $run_gpsdate = 0 ]; then exit 0; fi
echo "Restarting ${NAME}"
stop
start
;;
*)
echo "Usage: /etc/init.d/gpsdate {start|stop|restart|force-reload}"
exit 1
esac
exit 0