使用D+接口解析域名
This commit is contained in:
1 parent
e129176331
commit
e9757e33e0
1 file changed
+16
-15
+16
-15
@@ -1,29 +1,30 @@
|
|||||||
|
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
#################################################
|
#################################################
|
||||||
# AnripDdns v3.08.09
|
# AnripDdns v5.07.07
|
||||||
# 基于DNSPod用户API实现的动态域名客户端a
|
# 基于DNSPod用户API实现的动态域名客户端
|
||||||
# 作者: 若海[mail@anrip.com]
|
# 作者: 若海[mail@anrip.com]
|
||||||
# 介绍: http://www.anrip.com/ddnspod
|
# 介绍: http://www.anrip.com/ddnspod
|
||||||
# 时间: 2013-08-08 23:25:00
|
# 时间: 2015-07-07 10:25:00
|
||||||
#################################################
|
#################################################
|
||||||
|
|
||||||
# 全局变量表
|
# 全局变量表
|
||||||
arPass=arMail=""
|
arPass=arMail=""
|
||||||
|
|
||||||
# 获得外网地址
|
# 获得外网地址
|
||||||
arIpAdress() {
|
arIpAdress() {
|
||||||
local inter="http://members.3322.org/dyndns/getip"
|
local inter="http://members.3322.org/dyndns/getip"
|
||||||
wget --quiet --no-check-certificate --output-document=- $inter
|
wget --quiet --no-check-certificate --output-document=- $inter
|
||||||
}
|
}
|
||||||
|
|
||||||
# 查询域名地址
|
# 查询域名地址
|
||||||
# 参数: 待查询域名
|
# 参数: 待查询域名
|
||||||
arNslookup() {
|
arNslookup() {
|
||||||
local dnsvr="114.114.114.114"
|
local dnsvr="http://119.29.29.29/d?dn="
|
||||||
nslookup ${1} $dnsvr | tr -d '\n[:blank:]' | sed 's/.\+1 \([0-9\.]\+\)/\1/'
|
wget --quiet --no-check-certificate --output-document=- $dnsvr$1
|
||||||
}
|
}
|
||||||
|
|
||||||
# 读取接口数据
|
# 读取接口数据
|
||||||
# 参数: 接口类型 待提交数据
|
# 参数: 接口类型 待提交数据
|
||||||
arApiPost() {
|
arApiPost() {
|
||||||
@@ -32,7 +33,7 @@ arApiPost() {
|
|||||||
local param="login_email=${arMail}&login_password=${arPass}&format=json&${2}"
|
local param="login_email=${arMail}&login_password=${arPass}&format=json&${2}"
|
||||||
wget --quiet --no-check-certificate --output-document=- --user-agent=$agent --post-data $param $inter
|
wget --quiet --no-check-certificate --output-document=- --user-agent=$agent --post-data $param $inter
|
||||||
}
|
}
|
||||||
|
|
||||||
# 更新记录信息
|
# 更新记录信息
|
||||||
# 参数: 主域名 子域名
|
# 参数: 主域名 子域名
|
||||||
arDdnsUpdate() {
|
arDdnsUpdate() {
|
||||||
@@ -54,7 +55,7 @@ arDdnsUpdate() {
|
|||||||
# 输出错误信息
|
# 输出错误信息
|
||||||
echo $recordRS | sed 's/.\+,"message":"\([^"]\+\)".\+/\1/'
|
echo $recordRS | sed 's/.\+,"message":"\([^"]\+\)".\+/\1/'
|
||||||
}
|
}
|
||||||
|
|
||||||
# 动态检查更新
|
# 动态检查更新
|
||||||
# 参数: 主域名 子域名
|
# 参数: 主域名 子域名
|
||||||
arDdnsCheck() {
|
arDdnsCheck() {
|
||||||
@@ -72,13 +73,13 @@ arDdnsCheck() {
|
|||||||
fi
|
fi
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
###################################################
|
###################################################
|
||||||
|
|
||||||
# 设置用户参数
|
# 设置用户参数
|
||||||
arMail="user@anrip.com"
|
arMail="user@anrip.com"
|
||||||
arPass="anrip.net"
|
arPass="anrip.net"
|
||||||
|
|
||||||
# 检查更新域名
|
# 检查更新域名
|
||||||
arDdnsCheck "anrip.com" "lab"
|
arDdnsCheck "anrip.com" "lab"
|
||||||
arDdnsCheck "anrip.net" "lab"
|
arDdnsCheck "anrip.net" "lab"
|
||||||
Reference in new issue
Block a user