Fixes when get record IP fail will still update IP.

This commit is contained in:
wzhy90 committed 2017-03-05 18:04:51 +08:00
1 parent c4a5824403
commit 9bff199572
1 file changed
+7 -1
+7 -1
View File
@@ -127,10 +127,11 @@ arDdnsInfo() {
case "$recordIP" in
[1-9][0-9]*)
echo $recordIP
return 1
return 0
;;
*)
echo "Get Record Info Failed!"
return 1
;;
esac
}
@@ -180,8 +181,10 @@ arDdnsCheck() {
local postRS
local lastIP
local hostIP=$(arIpAddress)
echo "Updating Domain: ${2}.${1}"
echo "hostIP: ${hostIP}"
lastIP=$(arDdnsInfo "$1 $2")
if [ $? -eq 0 ]; then
echo "lastIP: ${lastIP}"
if [ "$lastIP" != "$hostIP" ]; then
postRS=$(arDdnsUpdate $1 $2)
@@ -192,6 +195,9 @@ arDdnsCheck() {
fi
echo "Last IP is the same as current IP!"
return 1
fi
echo ${lastIP}
return 1
}
# DDNS