xdtianyu / scripts

scripts for work
https://www.xdty.org
1.03k stars 245 forks source link

cloudxns ddns脚本运行出错 #4

Closed niclau closed 8 years ago

niclau commented 8 years ago

已确保conf填写正确,已在cloudxns上填写相应subdomain A记录 root@OpenWrt:~/ddns# ./cloudxns.sh cloudxns.conf DOMAIN ID: 53193 334499 RECORD ID: Invalid API request, may be your URL path error, please check your URL, and then try again. Fri Jan 1 10:10:12 HKT 2016 -- Update failed

xdtianyu commented 8 years ago

DOMAIN ID 看有两个域名,而查询 RECORD ID即子域名没有查询到

xdtianyu commented 8 years ago

能不能提供下你的两个域名是什么我检查下脚本,可能因为字符重叠没有过滤掉

niclau commented 8 years ago

我的conf下只有一个域名,一个纯数字的.net API_KEY="x" SECRET_KEY="x" DOMAIN="334499.net" HOST="ap" LAST_IP_FILE="/tmp/.LAST_IP"

xdtianyu commented 8 years ago

cloudxns里边是不是绑定了另一个字符类似的域名?

niclau commented 8 years ago

@xdtianyu 没有,另外的域名是全英文的。

xdtianyu commented 8 years ago

你是不是用的很久以前的脚本没有更新呢?

DOMAIN_ID=$(curl -k -s $URL_D -H "API-KEY: $API_KEY" -H "API-REQUEST-DATE: $DATE" -H "API-HMAC: $HMAC_D"|grep -o "id\":\"[0-9]*\",\"domain\":\"$DOMAIN"|grep -o "[0-9]*")行之前增加

echo $(curl -k -s $URL_D -H "API-KEY: $API_KEY" -H "API-REQUEST-DATE: $DATE" -H "API-HMAC: $HMAC_D")
exit 0

检查下输出贴一下

niclau commented 8 years ago

LOG removed.

xdtianyu commented 8 years ago

因为域名是纯数字,过滤时候把域名的数字部分也过滤出来了。稍等我更新下脚本

xdtianyu commented 8 years ago

注意删除之前的脚本文件,wget https://raw.githubusercontent.com/xdtianyu/scripts/master/ddns/cloudxns.sh 更新下脚本。再试下应该就好了

niclau commented 8 years ago

感谢,已更新成功。 PS:对于获取公网IP IP=$(curl -s ip.xdty.org),可以用dig +short myip.opendns.com @208.67.220.220 -p 443

xdtianyu commented 8 years ago

感谢反馈~