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.

46 lines
755 B

  1. #!/bin/sh /etc/rc.common
  2. USE_PROCD=1
  3. START=50
  4. STOP=50
  5. PROG=/usr/sbin/dawn
  6. NAME=dawn
  7. reload_service()
  8. {
  9. if service_running; then
  10. ubus call dawn reload_config
  11. else
  12. start
  13. fi
  14. }
  15. service_triggers()
  16. {
  17. procd_add_reload_trigger "dawn"
  18. }
  19. start_service()
  20. {
  21. local _tcp_buffer
  22. config_load dawn
  23. load_tcp_port() {
  24. config_get _tcp_buffer "$1" tcp_port
  25. }
  26. config_foreach load_tcp_port network
  27. touch /tmp/dawn_mac_list
  28. echo "Starting Service..."
  29. procd_open_instance
  30. procd_set_param command $PROG
  31. procd_set_param stdout 0 # here it is possible to remove the debug output...
  32. procd_set_param stderr 1
  33. procd_add_mdns "dawn" "tcp" "${_tcp_buffer}"
  34. procd_close_instance
  35. echo "Dawn instance started!"
  36. echo "UMDNS with port ${_tcp_buffer}"
  37. }