From 29050af84bc66747eb28f1859af920472aacd400 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 6 Dec 2023 00:24:05 +0800 Subject: [PATCH] update 2023-12-06 00:24:05 --- luci-app-aliddns/Makefile | 2 +- .../files/luci/i18n/aliddns.zh-cn.po | 3 +++ .../files/luci/model/cbi/aliddns.lua | 4 ++++ luci-app-aliddns/files/root/usr/sbin/aliddns | 16 ++++++++++++---- 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/luci-app-aliddns/Makefile b/luci-app-aliddns/Makefile index 356f58d73..f9dc0e7be 100644 --- a/luci-app-aliddns/Makefile +++ b/luci-app-aliddns/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-aliddns -PKG_VERSION:=0.4.0 +PKG_VERSION:=0.4.1 PKG_RELEASE:=1 PKG_LICENSE:=MIT diff --git a/luci-app-aliddns/files/luci/i18n/aliddns.zh-cn.po b/luci-app-aliddns/files/luci/i18n/aliddns.zh-cn.po index f0be976bc..c04edf030 100644 --- a/luci-app-aliddns/files/luci/i18n/aliddns.zh-cn.po +++ b/luci-app-aliddns/files/luci/i18n/aliddns.zh-cn.po @@ -10,6 +10,9 @@ msgstr "启用" msgid "Clean Before Update" msgstr "清除所有同名记录" +msgid "Enabled IPv4" +msgstr "启用 IPv4" + msgid "Enabled IPv6" msgstr "启用 IPv6" diff --git a/luci-app-aliddns/files/luci/model/cbi/aliddns.lua b/luci-app-aliddns/files/luci/model/cbi/aliddns.lua index f04ffbcd8..81e755dc7 100644 --- a/luci-app-aliddns/files/luci/model/cbi/aliddns.lua +++ b/luci-app-aliddns/files/luci/model/cbi/aliddns.lua @@ -15,6 +15,9 @@ enable.rmempty = false enable = e:option(Flag, "clean", translate("Clean Before Update")) enable.rmempty = false +ipv4 = e:option(Flag,"ipv4",translate("Enabled IPv4")) +ipv4.rmempty=false + ipv6 = e:option(Flag,"ipv6",translate("Enabled IPv6")) ipv6.rmempty=false @@ -33,6 +36,7 @@ iface6:value("",translate("Select WAN6-IP Source")) iface6:value("internet") iface6:value("wan") iface6:value("wan6") +iface6:value("wan_6") iface6.rmempty = true main = e:option(Value, "main_domain", translate("Main Domain"), translate("For example: test.github.com -> github.com")) diff --git a/luci-app-aliddns/files/root/usr/sbin/aliddns b/luci-app-aliddns/files/root/usr/sbin/aliddns index 086d1103b..20e732f0e 100755 --- a/luci-app-aliddns/files/root/usr/sbin/aliddns +++ b/luci-app-aliddns/files/root/usr/sbin/aliddns @@ -242,6 +242,8 @@ clean_log() { exit 1 } +ipv4=$(uci_get_by_name base ipv4) +ipv6=$(uci_get_by_name base ipv6) ak_id=$(uci_get_by_name base app_key) ak_sec=$(uci_get_by_name base app_secret) rrid=$(uci_get_by_name base record_id) @@ -269,10 +271,13 @@ DATE=$(date +'%Y-%m-%d %H:%M:%S') timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ") clean_log -check_aliddns || do_ddns_record +# uci_bool_by_name base ipv4 && check_aliddns || do_ddns_record +if [ $ipv4 -eq 1 ]; then + check_aliddns || do_ddns_record +fi # exit if ipv6 not-enabled -uci_bool_by_name base ipv6 || exit 0 +# uci_bool_by_name base ipv6 || exit 0 iface6=$(uci_get_by_name base interface6) if [ "Z$iface6" == "Zinternet" -o "Z$iface6" == "Z" ]; then @@ -282,5 +287,8 @@ else fi ip6_escape=`urlencode "$ip6"` -clean_log -check_aliddns6 || do_ddns_record6 +# clean_log +# uci_bool_by_name base ipv6 && check_aliddns6 || do_ddns_record6 +if [ $ipv6 -eq 1 ]; then + check_aliddns6 || do_ddns_record6 +fi