Fixes when get record IP fail will still update IP.
This commit is contained in:
1 parent
c4a5824403
commit
9bff199572
1 file changed
+14
-8
+14
-8
@@ -127,10 +127,11 @@ arDdnsInfo() {
|
|||||||
case "$recordIP" in
|
case "$recordIP" in
|
||||||
[1-9][0-9]*)
|
[1-9][0-9]*)
|
||||||
echo $recordIP
|
echo $recordIP
|
||||||
return 1
|
return 0
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "Get Record Info Failed!"
|
echo "Get Record Info Failed!"
|
||||||
|
return 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
}
|
}
|
||||||
@@ -180,17 +181,22 @@ arDdnsCheck() {
|
|||||||
local postRS
|
local postRS
|
||||||
local lastIP
|
local lastIP
|
||||||
local hostIP=$(arIpAddress)
|
local hostIP=$(arIpAddress)
|
||||||
|
echo "Updating Domain: ${2}.${1}"
|
||||||
echo "hostIP: ${hostIP}"
|
echo "hostIP: ${hostIP}"
|
||||||
lastIP=$(arDdnsInfo "$1 $2")
|
lastIP=$(arDdnsInfo "$1 $2")
|
||||||
echo "lastIP: ${lastIP}"
|
if [ $? -eq 0 ]; then
|
||||||
if [ "$lastIP" != "$hostIP" ]; then
|
echo "lastIP: ${lastIP}"
|
||||||
postRS=$(arDdnsUpdate $1 $2)
|
if [ "$lastIP" != "$hostIP" ]; then
|
||||||
echo "postRS: ${postRS}"
|
postRS=$(arDdnsUpdate $1 $2)
|
||||||
if [ $? -ne 1 ]; then
|
echo "postRS: ${postRS}"
|
||||||
return 0
|
if [ $? -ne 1 ]; then
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
echo "Last IP is the same as current IP!"
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
echo "Last IP is the same as current IP!"
|
echo ${lastIP}
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user