diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-10-04 11:37:21 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-10-04 11:37:21 +0200 |
commit | 4649284812bb3dbb8c07f0e4dc56226b6da1a703 (patch) | |
tree | c1b1a7fd01df61336b95838d05bfd2a643dbece7 /src/migration-scripts/sstp | |
parent | 585aaf9c5770e2a0784849aee75213bd4ea1871a (diff) | |
download | vyos-1x-4649284812bb3dbb8c07f0e4dc56226b6da1a703.tar.gz vyos-1x-4649284812bb3dbb8c07f0e4dc56226b6da1a703.zip |
sstp: T2953: migrate gateway-address, client-ip-settings to common level
* move "network-settings gateway-address" to "gateway-address"
* move "network-settings client-ip-settings" to "client-ip-pool"
Diffstat (limited to 'src/migration-scripts/sstp')
-rwxr-xr-x | src/migration-scripts/sstp/0-to-1 | 5 | ||||
-rwxr-xr-x | src/migration-scripts/sstp/2-to-3 | 21 |
2 files changed, 23 insertions, 3 deletions
diff --git a/src/migration-scripts/sstp/0-to-1 b/src/migration-scripts/sstp/0-to-1 index 0e8dd1c4b..dc65bdeab 100755 --- a/src/migration-scripts/sstp/0-to-1 +++ b/src/migration-scripts/sstp/0-to-1 @@ -107,9 +107,9 @@ else: config.delete(radius_server) # migrate SSL certificates - old_ssl = new_base + ['sstp-settings', 'ssl-certs'] + old_ssl = new_base + ['sstp-settings'] new_ssl = new_base + ['ssl'] - config.copy(old_ssl, new_ssl) + config.copy(old_ssl + ['ssl-certs'], new_ssl) config.delete(old_ssl) if config.exists(new_ssl + ['ca']): @@ -121,7 +121,6 @@ else: if config.exists(new_ssl + ['server-key']): config.rename(new_ssl + ['server-key'], 'key-file') - try: with open(file_name, 'w') as f: f.write(config.to_string()) diff --git a/src/migration-scripts/sstp/2-to-3 b/src/migration-scripts/sstp/2-to-3 index dc96a2d30..963b2ba4b 100755 --- a/src/migration-scripts/sstp/2-to-3 +++ b/src/migration-scripts/sstp/2-to-3 @@ -49,9 +49,30 @@ else: config.copy(config_mtu, base_path + ['mtu']) config.delete(config_mtu) + config_gw = base_path + ['network-settings', 'client-ip-settings', 'gateway-address'] + if config.exists(config_gw): + config.copy(config_gw, base_path + ['gateway-address']) + config.delete(config_gw) + + config_client_ip = base_path + ['network-settings', 'client-ip-settings'] + if config.exists(config_client_ip): + config.copy(config_client_ip, base_path + ['client-ip-pool']) + config.delete(config_client_ip) + + config_client_ipv6 = base_path + ['network-settings', 'client-ipv6-pool'] + if config.exists(config_client_ipv6): + config.copy(config_client_ipv6, base_path + ['client-ipv6-pool']) + config.delete(config_client_ipv6) + + # all nodes now have been migrated out of network-settings - delete node + config_nw_settings = base_path + ['network-settings'] + if config.exists(config_nw_settings): + config.delete(config_nw_settings) + try: with open(file_name, 'w') as f: f.write(config.to_string()) except OSError as e: print("Failed to save the modified config: {}".format(e)) exit(1) + |