Skip to content

Commit

Permalink
Add a comment referencing the update time
Browse files Browse the repository at this point in the history
  • Loading branch information
cotton105 committed Feb 10, 2024
1 parent 4ea9ba5 commit 7ae7791
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion cloudflare-ddns.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import threading
import time
import requests
from datetime import datetime

CONFIG_PATH = os.environ.get('CONFIG_PATH', os.getcwd())

Expand Down Expand Up @@ -137,12 +138,14 @@ def commitRecord(ip):
# Check if name provided is a reference to the root domain
if name != '' and name != '@':
fqdn = name + "." + base_domain_name
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
record = {
"type": ip["type"],
"name": fqdn,
"content": ip["ip"],
"proxied": proxied,
"ttl": ttl
"ttl": ttl,
"comment": f"Updated by CloudflareDDNS at {timestamp}."
}
dns_records = cf_api(
"zones/" + option['zone_id'] +
Expand Down

0 comments on commit 7ae7791

Please sign in to comment.