From bdcf586a6c15011b0d13fcec7de6cdacbca47ac1 Mon Sep 17 00:00:00 2001 From: Gilles Grandou Date: Tue, 8 Oct 2019 10:05:17 +0200 Subject: [PATCH] add support for multiple addresses in zone.list --- dyndomain | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dyndomain b/dyndomain index 2bf87fb..b23e748 100755 --- a/dyndomain +++ b/dyndomain @@ -103,7 +103,8 @@ def read_zone_list_from_file(zone_filename): config.read(zone_filename) for host in config: for p in config[host]: - zone_list.append([host, p.upper(), config[host][p]]) + for target in config[host][p].split('\n'): + zone_list.append([host, p.upper(), target]) return zone_list @@ -124,7 +125,10 @@ def write_zone_list_to_file(zone_filename, zone_list): for host,typefield,target in zone_list: if not host in config: config[host] = {} - config[host][typefield] = target + if typefield in config[host]: + config[host][typefield] += '\n'+target + else: + config[host][typefield] = target with open(zone_filename, 'w') as configfile: config.write(configfile)