Ignore conf files starting with . when generating config

This commit is contained in:
2025-09-04 01:19:52 +02:00
parent 470327dfad
commit a4e4701846

View File

@@ -594,12 +594,17 @@ class DNSManager:
try:
with open(view_cfg.config_file, 'w') as cfh:
for file in os.listdir(view_cfg.config_dir):
cfgfile = os.path.join(view_cfg.config_dir, file)
if not file.endswith('.conf') or not os.path.isfile(cfgfile):
if file.startswith('.') or not file.endswith('.conf'):
continue
cfgfile = os.path.join(view_cfg.config_dir, file)
if not os.path.isfile(cfgfile):
continue
with open(cfgfile, 'r') as fh:
cfh.write(fh.read())
cfh.write('\n')
except Exception as e:
raise RuntimeError(f'unable to generate view config: {e}')