ugps.init 373 B

12345678910111213141516171819202122
  1. #!/bin/sh /etc/rc.common
  2. # Copyright (c) 2014 OpenWrt.org
  3. START=80
  4. USE_PROCD=1
  5. PROG=/usr/sbin/ugps
  6. service_triggers() {
  7. procd_add_reload_trigger gps
  8. }
  9. start_service() {
  10. local tty="$(uci get gps.@gps[-1].tty)"
  11. [ -d "/sys/class/tty/$tty/" ] || return
  12. procd_open_instance
  13. procd_set_param command "$PROG" "/dev/$tty"
  14. procd_set_param respawn
  15. procd_close_instance
  16. }