mirror of
https://github.com/cupcakearmy/docker-ddns-cloudflare.git
synced 2024-12-22 07:46:24 +00:00
better logging
This commit is contained in:
parent
9d1a61cf21
commit
fcf2a0e1c7
4
run.sh
4
run.sh
@ -40,8 +40,6 @@ else
|
|||||||
echo "$record_identifier" >> $id_file
|
echo "$record_identifier" >> $id_file
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Updating $zone_identifier, $record_identifier"
|
|
||||||
|
|
||||||
update=$(curl -s -X PUT "https://api.cloudflare.com/client/v4/zones/$zone_identifier/dns_records/$record_identifier" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json" --data "{\"id\":\"$zone_identifier\",\"type\":\"A\",\"name\":\"$record_name\",\"content\":\"$ip\"}")
|
update=$(curl -s -X PUT "https://api.cloudflare.com/client/v4/zones/$zone_identifier/dns_records/$record_identifier" -H "X-Auth-Email: $auth_email" -H "X-Auth-Key: $auth_key" -H "Content-Type: application/json" --data "{\"id\":\"$zone_identifier\",\"type\":\"A\",\"name\":\"$record_name\",\"content\":\"$ip\"}")
|
||||||
|
|
||||||
if [[ $update == *"\"success\":false"* ]]; then
|
if [[ $update == *"\"success\":false"* ]]; then
|
||||||
@ -50,7 +48,7 @@ if [[ $update == *"\"success\":false"* ]]; then
|
|||||||
echo -e "$message"
|
echo -e "$message"
|
||||||
exit 1
|
exit 1
|
||||||
else
|
else
|
||||||
message="IP changed to: $ip"
|
message="$(date) - IP changed to: $ip"
|
||||||
echo "$ip" > $ip_file
|
echo "$ip" > $ip_file
|
||||||
log "$message"
|
log "$message"
|
||||||
echo "$message"
|
echo "$message"
|
||||||
|
Loading…
Reference in New Issue
Block a user