Add openwrt init script and uci config section

main
Nikita Tokarchuk 3 years ago
parent e46d38e3df
commit 72ff915b46
Signed by: mainnika
GPG Key ID: A595FB7E3E56911C
  1. 6
      net/coredns/Makefile
  2. 3
      net/coredns/files/coredns.conf
  3. 30
      net/coredns/files/coredns.init

@ -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
}
Loading…
Cancel
Save