summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-03-20 17:44:25 +0100
committerChristian Poessinger <christian@poessinger.com>2020-03-20 17:44:25 +0100
commit106406d46ba594b86056e3341314e9615a501dd5 (patch)
tree2b3ca45148aa3c5cfef0a7d086090919ea31737b /src/migration-scripts
parent77dde087219467ce8bfcf64a9f7452ca74d66c0c (diff)
downloadvyos-1x-106406d46ba594b86056e3341314e9615a501dd5.tar.gz
vyos-1x-106406d46ba594b86056e3341314e9615a501dd5.zip
sstp: T2008: dns: unwind configuration
Diffstat (limited to 'src/migration-scripts')
-rwxr-xr-xsrc/migration-scripts/sstp/0-to-113
1 files changed, 13 insertions, 0 deletions
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)