Skip to content

Commit

Permalink
ddns-script: add retry_max_count's upgrade script
Browse files Browse the repository at this point in the history
Signed-off-by: FriesI23 Qin <[email protected]>
  • Loading branch information
FriesI23 authored and feckert committed Feb 13, 2025
1 parent 6e80b3a commit f02a1df
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
6 changes: 5 additions & 1 deletion net/ddns-scripts/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk

PKG_NAME:=ddns-scripts
PKG_VERSION:=2.8.2
PKG_RELEASE:=61
PKG_RELEASE:=62

PKG_LICENSE:=GPL-2.0

Expand Down Expand Up @@ -362,6 +362,10 @@ define Package/ddns-scripts/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) ./files/usr/bin/ddns.sh \
$(1)/usr/bin/ddns

$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_DATA) ./files/etc/uci-defaults/50-ddns-migrate-retry-count \
$(1)/etc/uci-defaults/
endef

define Package/ddns-scripts/postinst
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/sh

. /lib/functions.sh

upgrade_to_retry_max_count() {
local service=$1
local retry_count retry_max_count

config_get retry_max_count $service retry_max_count
config_get retry_count $service retry_count
if [ -z "$retry_max_count" ] && [ -n "$retry_count" ]; then
uci_set ddns $service retry_max_count $retry_count
uci_commit ddns
fi
}

config_load ddns
config_foreach upgrade_to_retry_max_count service

exit 0

0 comments on commit f02a1df

Please sign in to comment.