You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
479 B
24 lines
479 B
#!/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)"
|
|
|
|
[ -d "/sys/class/tty/$tty/" ] || return
|
|
|
|
procd_open_instance
|
|
procd_set_param command "$PROG" "/dev/$tty"
|
|
[ "$atime" -eq 0 ] || procd_append_param command "-a"
|
|
procd_set_param respawn
|
|
procd_close_instance
|
|
}
|
|
|