diff --git a/src/plugins/network-manager/add_dns.py b/src/plugins/network-manager/add_dns.py index f925346..ad9a0a0 100644 --- a/src/plugins/network-manager/add_dns.py +++ b/src/plugins/network-manager/add_dns.py @@ -23,10 +23,10 @@ class AddDNS(AbstractPlugin): def handle_task(self): try: if self.is_active is True: - content = 'nameserver {}\n'.format(self.ip) + content = '\nnameserver {}\n'.format(self.ip) self.logger.debug('Created active dns content.') else: - content = '#nameserver {}\n'.format(self.ip) + content = '\n#nameserver {}\n'.format(self.ip) self.logger.debug('Created passive dns content.') self.logger.debug('Writing to file...') diff --git a/src/plugins/network-manager/add_domain.py b/src/plugins/network-manager/add_domain.py index 2da5deb..47f64fd 100644 --- a/src/plugins/network-manager/add_domain.py +++ b/src/plugins/network-manager/add_domain.py @@ -21,7 +21,7 @@ class AddDomain(AbstractPlugin): def handle_task(self): try: - content = 'domain {0}\nsearch {0}\n'.format(self.domain) + content = '\ndomain {0}\nsearch {0}\n'.format(self.domain) self.logger.debug('Writing to file...') self.write_file(self.dns_file, content, 'a') diff --git a/src/plugins/network-manager/add_host.py b/src/plugins/network-manager/add_host.py index 37f1687..243a864 100644 --- a/src/plugins/network-manager/add_host.py +++ b/src/plugins/network-manager/add_host.py @@ -24,10 +24,10 @@ class AddHost(AbstractPlugin): def handle_task(self): try: if self.is_active is True: - content = '{0} {1}\n'.format(self.ip, self.hostname) + content = '\n{0} {1}\n'.format(self.ip, self.hostname) self.logger.debug('Created active host content.') else: - content = '#{0} {1}\n'.format(self.ip, self.hostname) + content = '\n#{0} {1}\n'.format(self.ip, self.hostname) self.logger.debug('Created passive host content.') self.logger.debug('Writing to file...') diff --git a/src/plugins/network-manager/add_network.py b/src/plugins/network-manager/add_network.py index c7ceb0a..de01ede 100644 --- a/src/plugins/network-manager/add_network.py +++ b/src/plugins/network-manager/add_network.py @@ -32,12 +32,12 @@ class AddNetwork(AbstractPlugin): try: if self.type == 'STATIC': if self.is_active is True: - self.content = 'auto {0}\niface {0} inet static\naddress {1}\nnetmask {2}\ngateway {3}\n'.format(self.name, + self.content = '\nauto {0}\niface {0} inet static\naddress {1}\nnetmask {2}\ngateway {3}\n'.format(self.name, self.ip, self.netmask, self.gateway) else: - self.content = 'auto {0}\niface {0} inet static\n#address {1}\n#netmask {2}\n#gateway {3}\n'.format(self.name, + self.content = '\nauto {0}\niface {0} inet static\n#address {1}\n#netmask {2}\n#gateway {3}\n'.format(self.name, self.ip, self.netmask, self.gateway)