Skip to content

Commit

Permalink
Merge branch 'comment-update-time'
Browse files Browse the repository at this point in the history
  • Loading branch information
cotton105 committed Feb 10, 2024
2 parents 096ca0a + e5bce1b commit 0358e0b
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 Cloudflare DDNS at {timestamp}."
}
dns_records = cf_api(
"zones/" + option['zone_id'] +
Expand Down

0 comments on commit 0358e0b

Please sign in to comment.