ipv4: fixed broken request

This commit is contained in:
Roger Sikorski 2022-08-01 22:25:43 +02:00
parent 589f67b8c1
commit dd369c801d

View File

@ -31,10 +31,10 @@ dnsIp=$(echo $result | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b")
currentIp=$(curl -s GET "https://ipv4.wtfismyip.com/text") currentIp=$(curl -s GET "https://ipv4.wtfismyip.com/text")
echo "currentIp:" $currentIp echo "currentIp:" $currentIp
if [ $dnsIp != $currentIp ]; if [ $dnsIp != $currentIp ];
then then
# echo "Ips are not equal" ## debug # echo "Ips are not equal" ## debug
request='{"data":"'$currentIp'","ttl":600}' request='[{"data":"'$currentIp'","name":"'$name'","ttl":600,"type":"A"}]'
# echo $request # debug # echo $request # debug
nresult=$(curl -i -s -X PUT \ nresult=$(curl -i -s -X PUT \
-H "$headers" \ -H "$headers" \