Archived
1
0
This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
archive/package/utils/ugps/files/ugps.init
John Crispin 57ddea3a6a ugps: add a minimal gps daemon
* set the system time/data
* "ubus call gps info" will tell you lattitude, longitude, elevation, speed and bearing

Signed-off-by: John Crispin <blogic@openwrt.org>

SVN-Revision: 41929
2014-08-01 09:37:49 +00:00

23 lines
373 B
Bash

#!/bin/sh /etc/rc.common
# Copyright (c) 2014 OpenWrt.org
START=80
USE_PROCD=1
PROG=/usr/sbin/ugps
service_triggers() {
procd_add_reload_trigger gps
}
start_service() {
local tty="$(uci get gps.@gps[-1].tty)"
[ -d "/sys/class/tty/$tty/" ] || return
procd_open_instance
procd_set_param command "$PROG" "/dev/$tty"
procd_set_param respawn
procd_close_instance
}