Skip to content

Commit

Permalink
Write resolver file if dns or searchdomain have specified
Browse files Browse the repository at this point in the history
The file should always be written if the fileds have
been filled.

Signed-off-by: BenjiReis <benjamin.reis@vates.fr>
  • Loading branch information
benjamreis committed Jun 19, 2023
1 parent 6dbf4d6 commit 0f18e5d
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions netutil.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,11 @@ def writeResolverFile(configuration, filename):

for iface in configuration:
settings = configuration[iface]
if (not settings.isDynamic()) and settings.dns:
if settings.dns:
for server in settings.dns:
outfile.write("nameserver %s\n" % server)
if settings.domain:
outfile.write("search %s\n" % settings.domain)
if settings.dns:
for server in settings.dns:
outfile.write("nameserver %s\n" % server)
if settings.domain:
outfile.write("search %s\n" % settings.domain)

outfile.close()

Expand Down

0 comments on commit 0f18e5d

Please sign in to comment.