From 106406d46ba594b86056e3341314e9615a501dd5 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Fri, 20 Mar 2020 17:44:25 +0100 Subject: sstp: T2008: dns: unwind configuration --- src/migration-scripts/sstp/0-to-1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/migration-scripts/sstp') diff --git a/src/migration-scripts/sstp/0-to-1 b/src/migration-scripts/sstp/0-to-1 index 0fe1a203f..88d3b4fb4 100755 --- a/src/migration-scripts/sstp/0-to-1 +++ b/src/migration-scripts/sstp/0-to-1 @@ -45,6 +45,19 @@ else: config.copy(old_base, new_base) config.delete(old_base) + # migrate DNS servers + dns_base = new_base + ['network-settings', 'dns-server'] + if config.exists(dns_base): + if config.exists(dns_base + ['primary-dns']): + dns = config.return_value(dns_base + ['primary-dns']) + config.set(new_base + ['network-settings', 'name-server'], value=dns, replace=False) + + if config.exists(dns_base + ['secondary-dns']): + dns = config.return_value(dns_base + ['secondary-dns']) + config.set(new_base + ['network-settings', 'name-server'], value=dns, replace=False) + + config.delete(dns_base) + print(config.to_string()) sys.exit(1) -- cgit v1.2.3