https_dns_proxy.init 644 B

1234567891011121314151617181920212223242526272829303132
  1. #!/bin/sh /etc/rc.common
  2. START=80
  3. USE_PROCD=1
  4. PROG=/usr/sbin/https_dns_proxy
  5. start_instance() {
  6. local cfg="$1"
  7. local listen_addr listen_port user group
  8. config_get listen_addr "$cfg" listen_addr
  9. config_get listen_port "$cfg" listen_port
  10. config_get user "$cfg" user
  11. config_get group "$cfg" group
  12. procd_open_instance
  13. procd_set_param command ${PROG} \
  14. -a "$listen_addr" -p "$listen_port" \
  15. -u "$user" -g "$group"
  16. procd_set_param respawn
  17. procd_close_instance
  18. }
  19. service_triggers() {
  20. procd_add_reload_trigger "https_dns_proxy"
  21. }
  22. start_service() {
  23. config_load 'https_dns_proxy'
  24. config_foreach start_instance 'https_dns_proxy'
  25. }