aboutsummaryrefslogtreecommitdiffstats
path: root/main/gpsd/gpsd.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-10-23 19:49:40 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-10-23 19:49:40 +0000
commitce5599bf2453eb7d5f47828d4fb0d103f2a23e93 (patch)
tree616f542a13ca3667834748841e4a57c70ff690db /main/gpsd/gpsd.initd
parent5539fc3a45e29088e12f99ef2cc7b4ca4b819985 (diff)
downloadaports-ce5599bf2453eb7d5f47828d4fb0d103f2a23e93.tar.bz2
aports-ce5599bf2453eb7d5f47828d4fb0d103f2a23e93.tar.xz
main/gpsd: move from testing
and let abuild autodetect libcap dep
Diffstat (limited to 'main/gpsd/gpsd.initd')
-rw-r--r--main/gpsd/gpsd.initd36
1 files changed, 36 insertions, 0 deletions
diff --git a/main/gpsd/gpsd.initd b/main/gpsd/gpsd.initd
new file mode 100644
index 0000000000..985271f416
--- /dev/null
+++ b/main/gpsd/gpsd.initd
@@ -0,0 +1,36 @@
+#!/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"
+}