mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 07:28:39 +01:00
gpsd: initial add to packages
This package is currently in oldpackages. Add here to keep support for gpsd. From oldpackages, this was bumped from 3.10 -> 3.15 and includes an upstream patch to allow building with musl. Signed-off-by: Pushpal Sidhu <psidhu@gateworks.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
config gpsd core
|
||||
option device "/dev/ttyUSB0"
|
||||
option port "2947"
|
||||
option listen_globally "false"
|
||||
option enabled "true"
|
||||
@@ -0,0 +1,16 @@
|
||||
case "$ACTION" in
|
||||
add)
|
||||
# start process
|
||||
# only pl2303 devices are handled
|
||||
if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then
|
||||
sleep 3 && /etc/init.d/gpsd start
|
||||
fi
|
||||
;;
|
||||
remove)
|
||||
# stop process
|
||||
# only pl2303 devices are handled
|
||||
if [ "$PRODUCT" = "67b/2303/300" ] && [ "$TYPE" = "0/0/0" ] && [ "$INTERFACE" = "255/0/0" ]; then
|
||||
/etc/init.d/gpsd stop
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@@ -0,0 +1,32 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (C) 2009-2011 OpenWrt.org
|
||||
START=50
|
||||
|
||||
NAME=gpsd
|
||||
PIDF=/var/run/$NAME.pid
|
||||
PROG=/usr/sbin/$NAME
|
||||
|
||||
start() {
|
||||
config_load gpsd
|
||||
config_get device core device
|
||||
config_get port core port
|
||||
config_get_bool listen_globally core listen_globally
|
||||
config_get_bool enabled core enabled
|
||||
[ "$enabled" != "1" ] && exit
|
||||
logger -t "$NAME" "Starting..."
|
||||
[ ! -c "$device" ] && {
|
||||
logger -t "$NAME" "Unable to find device $device. Exiting."
|
||||
exit 1
|
||||
}
|
||||
[ "$listen_globally" != "0" ] && append args "-G"
|
||||
$PROG -n -P $PIDF -S $port $args $device
|
||||
}
|
||||
|
||||
stop() {
|
||||
logger -t "$NAME" "Stopping..."
|
||||
[ -f "$PIDF" ] && {
|
||||
read PID < "$PIDF"
|
||||
kill -9 $PID
|
||||
rm $PIDF
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user