Skip to content
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
7 changes: 3 additions & 4 deletions ddnspod/ddnspod/scripts/ddnspod_config.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,17 @@ arDdnsUpdate() {
}

arDdnsCheck() {
postRS
hostIP=$(arIpAdress)
lastIP=$(arNslookup "${2}.${1}")
echo "hostIP: ${hostIP}"
echo "lastIP: ${lastIP}"
if [ "$lastIP" != "$hostIP" ]; then
dbus set ddnspod_run_status="更新中。。。"
postRS=$(arDdnsUpdate $1 $2)
echo "postRS: ${postRS}"
if [ $? -ne 1 ]; then
echo "postRS: ${postRS}"
dbus set ddnspod_run_status="wan ip:${hostIP} 更新失败,原因:${postRS}"
return 1
return 1
fi
else
dbus set ddnspod_run_status="`echo_date` wan ip:${hostIP} 未改变,无需更新"
Expand All @@ -74,7 +73,7 @@ arDdnsCheck() {
}

parseDomain() {
mainDomain=${ddnspod_config_domain#*.}
mainDomain=$(echo $ddnspod_config_domain | awk '{n=split($0, a, "."); printf("%s.%s", a[n-1], a[n])}')
local tmp=${ddnspod_config_domain%$mainDomain}
subDomain=${tmp%.}
}
Expand Down