aports/main/gpsd/gpsd.initd
Natanael Copa ce5599bf24 main/gpsd: move from testing
and let abuild autodetect libcap dep
2012-10-23 19:49:40 +00:00

37 lines
673 B
Plaintext

#!/sbin/runscript
# Copyright 2012 Nathan Angelacos
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"
}