Comments (12)
已存在的记录 程序没办法知道你哪些要哪些不要 啊。 程序怎么敢乱删
from luci-app-aliddns.
我在name.com上有一个域名,也容易出现这个问题,我没有一个域名多个IP的需求(估计绝大多数人也没有吧),因此我在脚本里的处理方式是每次获取一次子域名对应的记录条数,然后遍历一遍,全部删掉,再添加新的,当然也可能遍历时某条删除失败,可以尝试删除多次,当然一般也不会那么点背总出问题吧
from luci-app-aliddns.
我自己就有子域名的需要,再说,用不到的子域名就由它在那里就好了
from luci-app-aliddns.
我的想法是:一个程序只做一件事,不能越俎代庖
from luci-app-aliddns.
没问题的啊,就是在更新当前子域名的时候,保证只存在一个正确的IP啊,多条IP本来就是之前更新带来的,按理说本来就应该处理掉
from luci-app-aliddns.
那不会出现一个子域名对应多个IP的情况,没遇过,具体情况是?
from luci-app-aliddns.
我没太看阿里的api,我用name.com的api时,是通过api获取对应子域名的解析记录ID,然后根据这个ID删除旧的记录,再添加新的。但是用curl的时候偶尔会超时,导致删除失败,如果接下来添加记录又成功了,那就会出现两条解析记录了,以后更新的时候因为也只是删一条,所以记录就会越来越多。
没仔细看阿里的api,是不是差不多呢,网络不好,或者在插件配置页面点了多次应用,然后阴差阳错,机缘巧合,就会导致添加多条解析记录了
from luci-app-aliddns.
阿里的API, 一个域名对应一个值,这里是A值,这程序只会在(不存在这个子域名)的时候去添加,已存在只会修改。
from luci-app-aliddns.
比如办公室里的一台刷了x86 lede的软路由,这几天由于上层交换机故障,IP频繁变化,还时不时断网,然后就出现了多条记录
https://i.loli.net/2018/01/18/5a608afe7fcdb.png
from luci-app-aliddns.
我测试一下
from luci-app-aliddns.
关于解析遗留的问题,我测试基本是和SignatureNonce相关的,同时也不用全删,所以我建议改成这样:
do_ddns_record() {
if uci_bool_by_name base clean ; then
query_recordid | get_recordid | while read rr; do
if [ "Z$rr" != "Z$rrid" ]; then
echo "$DATE Clean record $sub_dm.$main_dm: $rr"
suffix=awk -v min=1000 -v max=9999 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")$suffix
del_record $rr >/dev/null
fi
done
fi
suffix=awk -v min=1000 -v max=9999 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")$suffix
rrid=query_recordid | get_recordid
suffix=awk -v min=1000 -v max=9999 'BEGIN{srand(); print int(min+rand()*(max-min+1))}'
timestamp=$(date -u "+%Y-%m-%dT%H%%3A%M%%3A%SZ")$suffix
if [ "Z$rrid" == "Z" ]; then
rrid=add_record | get_recordid
echo "$DATE ADD record $rrid"
else
update_record $rrid >/dev/null 2>&1
echo "$DATE UPDATE record $rrid"
fi
if [ "Z$rrid" == "Z" ]; then
# failed
echo "$DATE # ERROR, Please Check Config/Time"
else
# save rrid
uci set aliddns.base.record_id=$rrid
uci commit aliddns
echo "$DATE # UPDATED($ip)"
fi
}
from luci-app-aliddns.
@islercn please make a pull request
from luci-app-aliddns.
Related Issues (20)
- 更新方式 HOT 1
- wan模式取到两个外网IP
- 能否支持阿里ipv6呢 HOT 3
- 能否出个勾选框,VIP DNS,吗;然后可以设置更新时间在,1-59s,TTL 时间也可以自定义 HOT 2
- 能否增加对*泛域名解析的支持 HOT 1
- 最新预发布版本不能使用 HOT 1
- ipv6 internet获取有几处错误 HOT 3
- 可以配置只解析ipv6地址么,请问怎么配置 HOT 2
- 无法更新域名 HOT 1
- 无法获取wan口IP HOT 5
- 集成到xiaozhuai/openwrt_handmade_packages
- 该插插件不支持openwrt 22.03编译吗,编译时出现toolchian无法通过的情况 HOT 2
- 能获得domain-ip一直提示Please Check Config/Time是什么问题啊 HOT 1
- openwrt已经更新,此插件是否考虑更新? HOT 2
- 能通过访问一个地址获取ip地址吗? HOT 2
- 在lede的master分之上安装的时候有点问题
- 无法更新@记录和*记录 HOT 1
- 能否支持多个子域名解析呢 HOT 1
- 无法使用uci配置 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from luci-app-aliddns.