mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-27 09:12:39 +00:00
0cb669b469
The ugps tool expects device path in last argument. If it's provided before other options, they won't be processed at all. Additionally, make it possible to use absolute path for gps character device in related uci configuration. Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
29 lines
528 B
Bash
29 lines
528 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)"
|
|
local atime="$(uci get gps.@gps[-1].adjust_time)"
|
|
|
|
[ -c "$tty" ] || {
|
|
tty="/dev/$tty"
|
|
[ -c "$tty" ] || return
|
|
}
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$PROG"
|
|
[ "$atime" -eq 0 ] || procd_append_param command "-a"
|
|
procd_append_param command "$tty"
|
|
procd_set_param respawn
|
|
procd_close_instance
|
|
}
|