1
0
mirror of https://github.com/kenzok8/small-package synced 2025-09-20 19:11:30 +08:00

update 2022-08-15 20:21:08

This commit is contained in:
github-actions[bot]
2022-08-15 20:21:08 +08:00
parent 56ef38d8cc
commit 6525a7798b
4 changed files with 23 additions and 14 deletions

View File

@ -10,11 +10,11 @@ include $(TOPDIR)/rules.mk
PKG_ARCH_DDNSTO:=$(ARCH)
PKG_NAME:=ddnsto
PKG_VERSION:=3.0.0
PKG_RELEASE:=$(PKG_ARCH_DDNSTO)-1
PKG_VERSION:=3.0.2
PKG_RELEASE:=$(PKG_ARCH_DDNSTO)-4
PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://fw.koolcenter.com/binary/ddnsto/
PKG_HASH:=361dee2ef52f711a35155d6a3ec180de6cdccb591c6bce34e24d8e51ceb75682
PKG_HASH:=76e6dc6a51176062a625f7bc9931d8709f81146603f5a7da853f1dc9ab2a05a3
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION)
@ -56,11 +56,10 @@ endef
define Package/$(PKG_NAME)/install
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/config $(1)/etc/init.d $(1)/etc/uci-defaults
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ddnsto.$(PKG_ARCH_DDNSTO) $(1)/usr/sbin/ddnsto
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ddnsto.$(PKG_ARCH_DDNSTO) $(1)/usr/sbin/ddnstod
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ddwebdav.$(PKG_ARCH_DDNSTO) $(1)/usr/sbin/ddwebdav
$(INSTALL_CONF) ./files/ddnsto.config $(1)/etc/config/ddnsto
$(INSTALL_BIN) ./files/ddnsto.init $(1)/etc/init.d/ddnsto
$(INSTALL_BIN) ./files/ddnsto-monitor.sh $(1)/usr/sbin/ddnsto-monitor.sh
$(INSTALL_BIN) ./files/ddnsto.uci-default $(1)/etc/uci-defaults/ddnsto
endef

18
ddnsto/files/ddnsto.init Normal file → Executable file
View File

@ -8,19 +8,29 @@ get_config() {
config_get_bool logger $1 logger 0
config_get token $1 token
config_get index $1 index 0
config_get_bool feat_enabled $1 feat_enabled 1
}
ddnsto_prepare() {
killall ddnstod 2>/dev/null
killall ddwebdav 2>/dev/null
}
start_service() {
ddnsto_prepare
config_load ddnsto
config_foreach get_config ddnsto
[ $enabled != 1 ] && return 1
if [ $enabled != 1 ]; then
return 1
fi
if [ -z "$token" ]; then
logger -t ddnsto -p warn "token not set"
return 1
fi
procd_open_instance
procd_set_param command /usr/sbin/ddnsto-monitor.sh -u "$token" -x $index
procd_set_param command /usr/sbin/ddnstod -u "$token" -x $index -F
[ "$logger" == 1 ] && procd_set_param stderr 1
procd_set_param respawn
procd_close_instance
@ -28,4 +38,4 @@ start_service() {
service_triggers() {
procd_add_reload_trigger "ddnsto"
}
}

View File

@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
LUCI_TITLE:=LuCI support for ddnsto
LUCI_DEPENDS:=+ddnsto
LUCI_PKGARCH:=all
PKG_VERSION:=3.0.1
PKG_VERSION:=3.0.2
PKG_RELEASE:=0
include $(TOPDIR)/feeds/luci/luci.mk

View File

@ -69,11 +69,11 @@ local function status_container()
local webdav_url = "未启用"
local wol_running = "未启用"
local cmd = "/usr/sbin/ddnsto -x ".. tostring(get_data().index) .." -w | awk '{print $2}'"
local cmd = "/usr/sbin/ddnstod -x ".. tostring(get_data().index) .." -w | awk '{print $2}'"
local device_id = get_command(cmd)
local version = get_command("/usr/sbin/ddnsto -v")
local version = get_command("/usr/sbin/ddnstod -v")
if sys.call("pidof ddnsto >/dev/null") == 0 then
if sys.call("pidof ddnstod >/dev/null") == 0 then
running = "<a style=\"color:green;font-weight:bolder\">已启动</a>"
end
@ -446,7 +446,7 @@ end
function ddnsto_status()
local sys = require "luci.sys"
local status = {
running = (sys.call("pidof ddnsto >/dev/null") == 0)
running = (sys.call("pidof ddnstod >/dev/null") == 0)
}
luci.http.prepare_content("application/json")