Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

代码整理 #116

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Copyright (C) 2014-2018 OpenWrt-dist
# Copyright (C) 2014-2018 Jian Chang <[email protected]>
# Copyright (C) 2014-2020 Jian Chang <[email protected]>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
Expand All @@ -15,15 +15,14 @@ PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/aa65535/ChinaDNS.git
PKG_SOURCE_VERSION:=00616680114011553881760e843b77a3519e8fbf
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.xz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_SOURCE_SUBDIR)

PKG_LICENSE:=GPLv3
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Jian Chang <[email protected]>

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)/$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION)

PKG_INSTALL:=1
PKG_FIXUP:=autoreconf
PKG_USE_MIPS16:=0
Expand All @@ -48,13 +47,13 @@ define Package/ChinaDNS/conffiles
endef

define Package/ChinaDNS/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/chinadns.init $(1)/etc/init.d/chinadns
$(INSTALL_CONF) $(PKG_BUILD_DIR)/chnroute.txt $(1)/etc/chinadns_chnroute.txt
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_DATA) ./files/chinadns.config $(1)/etc/config/chinadns
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/chinadns $(1)/usr/bin
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) files/chinadns.init $(1)/etc/init.d/chinadns
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_CONF) files/chinadns.config $(1)/etc/config/chinadns
$(INSTALL_DATA) $(PKG_BUILD_DIR)/chnroute.txt $(1)/etc/chinadns_chnroute.txt
endef

$(eval $(call BuildPackage,ChinaDNS))
1 change: 1 addition & 0 deletions files/chinadns.config
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ config chinadns
option addr '0.0.0.0'
option port '5353'
option server '114.114.114.114,8.8.4.4'

8 changes: 4 additions & 4 deletions files/chinadns.init
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/sh /etc/rc.common
#
# Copyright (C) 2014-2018 OpenWrt-dist
# Copyright (C) 2014-2018 Jian Chang <[email protected]>
# Copyright (C) 2014-2020 Jian Chang <[email protected]>
#
# This is free software, licensed under the GNU General Public License v3.
# See /LICENSE for more information.
Expand All @@ -28,9 +28,9 @@ append_parm() {
local switch="$3"
local default="$4"
local _loctmp
config_get _loctmp "$section" "$option"
[ -n "$_loctmp" -o -n "$default" ] || return 0
procd_append_param command "$switch" "${_loctmp:-$default}"
config_get _loctmp "$section" "$option" "$default"
[ -n "$_loctmp" ] || return 0
procd_append_param command "$switch" "$_loctmp"
}

start_instance() {
Expand Down