gluon-respondd 835 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh /etc/rc.common
  2. USE_PROCD=1
  3. START=50
  4. DAEMON=/usr/bin/respondd
  5. start_service() {
  6. DEVS=""
  7. for dev in $( ubus call network.interface dump | jsonfilter \
  8. -e "@.interface[@.proto='gluon_mesh' && @.up=true].device" \
  9. -e "@.interface[@.interface='$(cat /lib/gluon/respondd/client.dev 2>/dev/null)' && @.up=true].device")
  10. do
  11. DEVS="$DEVS -i $dev"
  12. done
  13. procd_open_instance
  14. procd_set_param command $DAEMON -g ff02::2:1001 -p 1001 -d /lib/gluon/respondd $DEVS
  15. procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5}
  16. procd_set_param stderr 1
  17. procd_close_instance
  18. }
  19. service_triggers() {
  20. local script=$(readlink "$initscript")
  21. local name=$(basename ${script:-$initscript})
  22. procd_open_trigger
  23. procd_add_raw_trigger "interface.*" 0 "/etc/init.d/$name" reload
  24. procd_close_trigger
  25. }