summaryrefslogtreecommitdiff
path: root/src/migration-scripts/pppoe-server
diff options
context:
space:
mode:
authoraapostoliuk <a.apostoliuk@vyos.io>2023-12-05 13:25:52 +0200
committerChristian Breunig <christian@breunig.cc>2023-12-28 16:35:01 +0100
commit428d3121de49e608a6e03a5456dd63b8b48bebe9 (patch)
treea1635524a45883897d29efa70a924bd2d8d62568 /src/migration-scripts/pppoe-server
parentd5062cb045fae8b0b5d68b3b1198c3b86de4d558 (diff)
downloadvyos-1x-428d3121de49e608a6e03a5456dd63b8b48bebe9.tar.gz
vyos-1x-428d3121de49e608a6e03a5456dd63b8b48bebe9.zip
accel-ppp: T5688: Fixed migration script for pppoe-server
Fixed migration script for pppoe-server (cherry picked from commit 17722f3ee1151d2e4ccf23655f7079615bf61e24)
Diffstat (limited to 'src/migration-scripts/pppoe-server')
-rwxr-xr-xsrc/migration-scripts/pppoe-server/6-to-736
1 files changed, 19 insertions, 17 deletions
diff --git a/src/migration-scripts/pppoe-server/6-to-7 b/src/migration-scripts/pppoe-server/6-to-7
index 8b5482705..34996d8fe 100755
--- a/src/migration-scripts/pppoe-server/6-to-7
+++ b/src/migration-scripts/pppoe-server/6-to-7
@@ -76,23 +76,25 @@ if config.exists(base + ['gateway-address']):
#named pool migration
namedpools_base = pool_base + ['name']
-if config.return_value(base + ['authentication', 'mode']) == 'local':
- if config.list_nodes(namedpools_base):
- default_pool = config.list_nodes(namedpools_base)[0]
-
-for pool_name in config.list_nodes(namedpools_base):
- pool_path = namedpools_base + [pool_name]
- if config.exists(pool_path + ['subnet']):
- subnet = config.return_value(pool_path + ['subnet'])
- config.set(pool_base + [pool_name, 'range'], value=subnet)
- if config.exists(pool_path + ['next-pool']):
- next_pool = config.return_value(pool_path + ['next-pool'])
- config.set(pool_base + [pool_name, 'next-pool'], value=next_pool)
- if not gateway:
- if config.exists(pool_path + ['gateway-address']):
- gateway = config.return_value(pool_path + ['gateway-address'])
-
-config.delete(namedpools_base)
+if config.exists(namedpools_base):
+ if config.exists(base + ['authentication', 'mode']):
+ if config.return_value(base + ['authentication', 'mode']) == 'local':
+ if config.list_nodes(namedpools_base):
+ default_pool = config.list_nodes(namedpools_base)[0]
+
+ for pool_name in config.list_nodes(namedpools_base):
+ pool_path = namedpools_base + [pool_name]
+ if config.exists(pool_path + ['subnet']):
+ subnet = config.return_value(pool_path + ['subnet'])
+ config.set(pool_base + [pool_name, 'range'], value=subnet)
+ if config.exists(pool_path + ['next-pool']):
+ next_pool = config.return_value(pool_path + ['next-pool'])
+ config.set(pool_base + [pool_name, 'next-pool'], value=next_pool)
+ if not gateway:
+ if config.exists(pool_path + ['gateway-address']):
+ gateway = config.return_value(pool_path + ['gateway-address'])
+
+ config.delete(namedpools_base)
if gateway:
config.set(base + ['gateway-address'], value=gateway)