Fixes update IP success or not.
After echo some things, the return will allways be 0.
This commit is contained in:
1 parent
9bff199572
commit
808066b5a3
1 file changed
+4
-3
+4
-3
@@ -169,10 +169,11 @@ arDdnsUpdate() {
|
|||||||
# Output IP
|
# Output IP
|
||||||
if [ "$recordCD" = "1" ]; then
|
if [ "$recordCD" = "1" ]; then
|
||||||
echo $recordRS | sed 's/.*,"value":"\([0-9\.]*\)".*/\1/'
|
echo $recordRS | sed 's/.*,"value":"\([0-9\.]*\)".*/\1/'
|
||||||
return 1
|
return 0
|
||||||
fi
|
fi
|
||||||
# Echo error message
|
# Echo error message
|
||||||
echo $recordRS | sed 's/.*,"message":"\([^"]*\)".*/\1/'
|
echo $recordRS | sed 's/.*,"message":"\([^"]*\)".*/\1/'
|
||||||
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
# DDNS Check
|
# DDNS Check
|
||||||
@@ -188,8 +189,8 @@ arDdnsCheck() {
|
|||||||
echo "lastIP: ${lastIP}"
|
echo "lastIP: ${lastIP}"
|
||||||
if [ "$lastIP" != "$hostIP" ]; then
|
if [ "$lastIP" != "$hostIP" ]; then
|
||||||
postRS=$(arDdnsUpdate $1 $2)
|
postRS=$(arDdnsUpdate $1 $2)
|
||||||
echo "postRS: ${postRS}"
|
if [ $? -eq 0 ]; then
|
||||||
if [ $? -ne 1 ]; then
|
echo "postRS: ${postRS}"
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in new issue
Block a user