Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

增加支持同域名多记录支持 #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion update_aliyun_com.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,17 @@ __SEPARATOR="&"
[ "$domain" == "${domain/@/}" ] && domain="${domain/./@}" # 未找到分隔符,兼容常用域名格式
__HOST="${domain%%@*}"
__DOMAIN="${domain#*@}"

__DOMAIN_IDX=1
if [ "$domain" != "${domain/|/}" ]
then
__DOMAIN_IDX="${__DOMAIN#*|}"
__DOMAIN="${__DOMAIN%%|*}"
write_log 7 "发现配置域名索引位:$__DOMAIN_IDX"
fi

write_log 7 "当前域名索引位:$__DOMAIN_IDX"

[ -z "$__HOST" -o "$__HOST" == "$__DOMAIN" ] && __HOST="@"

# 设置记录类型
Expand Down Expand Up @@ -206,7 +217,7 @@ describe_domain() {
else
json_select "DomainRecords" >/dev/null 2>&1
json_select "Record" >/dev/null 2>&1
json_select 1 >/dev/null 2>&1
json_select $__DOMAIN_IDX >/dev/null 2>&1
json_get_var value "Locked"
[ $value -ne 0 ] && write_log 14 "解析记录被锁定"
json_get_var __RECID "RecordId"
Expand Down