From fcf2a0e1c7482519f1b81de6755e49162064bb52 Mon Sep 17 00:00:00 2001 From: nicco Date: Tue, 22 Jan 2019 13:04:02 +0100 Subject: [PATCH] better logging --- run.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/run.sh b/run.sh index 004cd86..2e28583 100644 --- a/run.sh +++ b/run.sh @@ -40,8 +40,6 @@ else echo "$record_identifier" >> $id_file 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\"}") if [[ $update == *"\"success\":false"* ]]; then @@ -50,7 +48,7 @@ if [[ $update == *"\"success\":false"* ]]; then echo -e "$message" exit 1 else - message="IP changed to: $ip" + message="$(date) - IP changed to: $ip" echo "$ip" > $ip_file log "$message" echo "$message"