lllvcs / huaweicloud_ddns Goto Github PK
View Code? Open in Web Editor NEW基于华为云API实现的纯Shell动态域名客户端,支持在线查询或通过网卡获取IP地址
License: GNU General Public License v3.0
基于华为云API实现的纯Shell动态域名客户端,支持在线查询或通过网卡获取IP地址
License: GNU General Public License v3.0
1.TARGET_IP变量在调用系统命令ifconfig时可以加入| grep 'inet6 (ipv6固定前缀)'来避免某些情况下公网ipv6地址行数跳变的情况,ipv6固定前缀可以只输入头4位如2049即可
2.建议加入对云解析地址与本机ipv6地址的比较判断,不同时则调用api修改,相同时则不做修改,以下是我魔改后获取云解析地址的代码
HWcloud_IP=$(echo $(curl -X GET -L -k "https://$DNS/v2/zones/$ZONE_ID/recordsets/$RECORDSET_ID" \ -H "X-Auth-Token: $TOKEN" \ -H "Content-Type: application/json" \ -H "X-Project-Id: $PROJECT_ID")| sed 's/,/\n/g'|grep 'records'| grep -oE '(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))')
`其中有一个变量PROJECT_ID需要在华为云APIexplorer的showRecordSet中填写id后的调试结果中的请求头X-Project-Id看到
网上现成的好像都是 dnspod这些
华为云免费1ttl
应该需求还是挺多的
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.