summaryrefslogtreecommitdiff
path: root/net/https-dns-proxy/files/https_dns_proxy.init
diff options
context:
space:
mode:
authorYousong Zhou <yszhou4tech@gmail.com>2016-06-21 18:19:05 +0800
committerGitHub <noreply@github.com>2016-06-21 18:19:05 +0800
commit297e8dfc4d64f634913b56a9f232140465ab5e61 (patch)
tree6dc90458918f31cdedbe5717de9145e3f69089fd /net/https-dns-proxy/files/https_dns_proxy.init
parent8a5b249c2cdeb14c96456174f76f82f0c46862c1 (diff)
parent90ff49bd400e8786ada51a9279a6851c26a0e497 (diff)
Merge pull request #2666 from aarond10/https_dns_proxy
Https dns proxy
Diffstat (limited to 'net/https-dns-proxy/files/https_dns_proxy.init')
-rw-r--r--net/https-dns-proxy/files/https_dns_proxy.init32
1 files changed, 32 insertions, 0 deletions
diff --git a/net/https-dns-proxy/files/https_dns_proxy.init b/net/https-dns-proxy/files/https_dns_proxy.init
new file mode 100644
index 000000000..df1b22045
--- /dev/null
+++ b/net/https-dns-proxy/files/https_dns_proxy.init
@@ -0,0 +1,32 @@
+#!/bin/sh /etc/rc.common
+
+START=80
+
+USE_PROCD=1
+PROG=/usr/sbin/https_dns_proxy
+
+start_instance() {
+ local cfg="$1"
+ local listen_addr listen_port user group
+
+ config_get listen_addr "$cfg" listen_addr
+ config_get listen_port "$cfg" listen_port
+ config_get user "$cfg" user
+ config_get group "$cfg" group
+
+ procd_open_instance
+ procd_set_param command ${PROG} \
+ -l "$listen_addr" -p "$listen_port" \
+ -u "$user" -g "$group"
+ procd_set_param respawn
+ procd_close_instance
+}
+
+service_triggers() {
+ procd_add_reload_trigger "https_dns_proxy"
+}
+
+start_service() {
+ config_load 'https_dns_proxy'
+ config_foreach start_instance 'https_dns_proxy'
+}