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.

30 lines
600 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2009-2012 OpenWrt.org
  3. START=60
  4. USE_PROCD=1
  5. pidfile=/var/run/nfcapd.pid
  6. PROG=/usr/bin/nfcapd
  7. validate_nfcapd_section() {
  8. uci_validate_section nfcapd nfcapd "${1}" \
  9. 'enabled:bool' \
  10. 'port:string' \
  11. 'logdir:string'
  12. }
  13. start_service() {
  14. validate_nfcapd_section nfcapd || {
  15. echo "validation failed"
  16. return 1
  17. }
  18. [ "$enabled" -gt 0 ] && {
  19. procd_open_instance
  20. procd_set_param stdout 1
  21. procd_set_param stderr 1
  22. procd_set_param command "$PROG"
  23. procd_append_param command -S 1 -P "$pidfile" -p "$port" -l "$logdir"
  24. procd_close_instance
  25. }
  26. }