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.

42 lines
900 B

  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. config_get subnet_addr "$cfg" subnet_addr
  13. config_get proxy_server "$cfg" proxy_server
  14. if [ -n "$subnet_addr" ]; then
  15. subnet_param="-e $subnet_addr"
  16. fi
  17. if [ -n "$proxy_server" ]; then
  18. proxy_param="-t $proxy_server"
  19. fi
  20. procd_open_instance
  21. procd_set_param command ${PROG} \
  22. -a "$listen_addr" -p "$listen_port" \
  23. -u "$user" -g "$group" $subnet_param $proxy_param
  24. procd_set_param respawn
  25. procd_close_instance
  26. }
  27. service_triggers() {
  28. procd_add_reload_trigger "https_dns_proxy"
  29. }
  30. start_service() {
  31. config_load 'https_dns_proxy'
  32. config_foreach start_instance 'https_dns_proxy'
  33. }