mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-12-31 22:32:14 +01:00
39 lines
700 B
Plaintext
39 lines
700 B
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 2012 Nathan Angelacos
|
|
|
|
description="GPS daemon"
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
use ntp-server
|
|
}
|
|
|
|
GPS=${SVCNAME#*.}
|
|
if [ -n "${GPS}" ] && [ ${SVCNAME} != "gpsd" ]; then
|
|
GPSPID="/var/run/gpsd.${GPS}.pid"
|
|
else
|
|
GPSPID="/var/run/gpsd.pid"
|
|
fi
|
|
|
|
start() {
|
|
|
|
if [ -z "${DEVICE}" ]; then
|
|
eerror "Specify a GPS device in /etc/conf.d/${SVCNAME}"
|
|
return 1
|
|
fi
|
|
|
|
ebegin "Starting gpsd"
|
|
start-stop-daemon --start --quiet \
|
|
--exec /usr/sbin/gpsd \
|
|
-- ${ARGS} -P "${GPSPID}" ${DEVICE}
|
|
eend $? "Failed to start gpsd"
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping gpsd"
|
|
start-stop-daemon --stop --quiet \
|
|
--pidfile "${GPSPID}"
|
|
eend $? "Failed to stop gpsd"
|
|
}
|