Update porkbun-ddns.py

awa
This commit is contained in:
iacore 2024-01-11 20:32:14 +00:00
parent 747d6c3f5f
commit 8a612a11d5

View file

@ -45,7 +45,7 @@ def edit_record(id, ip):
# Update records
for record in api(endpoint + 'dns/retrieve/' + data['domain'])['records']:
if record['name'] == domain and record['type'] in 'AAAA':
if record['name'] == domain and record['type'] in ['A', 'AAAA']:
ip = ip_address(api((endpoint_ipv4 if record['type'] == 'A' else endpoint) + 'ping')['yourIp'])
if not str(ip) == record['content']:
print(edit_record(record['id'], ip))