mirror of
https://github.com/mainnika/openwrt-feed-coredns.git
synced 2026-05-23 00:03:35 +00:00
Add openwrt init script and uci config section
This commit is contained in:
@@ -38,6 +38,12 @@ define Package/coredns/install
|
|||||||
$(INSTALL_DIR) $(1)/usr/sbin
|
$(INSTALL_DIR) $(1)/usr/sbin
|
||||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/coredns $(1)/usr/sbin/
|
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/coredns $(1)/usr/sbin/
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/etc/init.d
|
||||||
|
$(INSTALL_BIN) ./files/coredns.init $(1)/etc/init.d/coredns
|
||||||
|
|
||||||
|
$(INSTALL_DIR) $(1)/etc/config
|
||||||
|
$(INSTALL_CONF) ./files/coredns.config $(1)/etc/config/coredns
|
||||||
|
|
||||||
$(INSTALL_DIR) $(1)/etc/coredns
|
$(INSTALL_DIR) $(1)/etc/coredns
|
||||||
$(INSTALL_CONF) ./files/Corefile $(1)/etc/coredns/Corefile
|
$(INSTALL_CONF) ./files/Corefile $(1)/etc/coredns/Corefile
|
||||||
endef
|
endef
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
config coredns 'main'
|
||||||
|
option port '53'
|
||||||
|
option config '/etc/coredns/Corefile'
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh /etc/rc.common
|
||||||
|
# Copyright (C) 2022 Nikita Tokarchuk
|
||||||
|
|
||||||
|
START=90
|
||||||
|
|
||||||
|
USE_PROCD=1
|
||||||
|
|
||||||
|
NAME=coredns
|
||||||
|
COMMAND=/usr/sbin/$NAME
|
||||||
|
|
||||||
|
start_service() {
|
||||||
|
config_load $NAME
|
||||||
|
|
||||||
|
config_get port main port '53'
|
||||||
|
config_get config main config '/etc/coredns/Corefile'
|
||||||
|
|
||||||
|
procd_open_instance
|
||||||
|
procd_set_param command $COMMAND
|
||||||
|
procd_append_param command \
|
||||||
|
-p $port \
|
||||||
|
-conf $config
|
||||||
|
procd_set_param limits nofile=4096
|
||||||
|
procd_set_param stderr 1
|
||||||
|
procd_set_param stdout 1
|
||||||
|
procd_close_instance
|
||||||
|
}
|
||||||
|
|
||||||
|
reload_service() {
|
||||||
|
procd_send_signal $NAME
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user