summaryrefslogtreecommitdiff
path: root/src/migration-scripts/dns-dynamic
diff options
context:
space:
mode:
authorIndrajit Raychaudhuri <irc@indrajit.com>2023-11-02 20:15:49 -0500
committerIndrajit Raychaudhuri <irc@indrajit.com>2023-11-30 21:42:23 -0600
commit4419244972ad1183ae42665dd453abb19e162ed5 (patch)
tree920e0f444bdeabfcb25451b58b2fd1b8d9ecf697 /src/migration-scripts/dns-dynamic
parente058ee4909728541f3cd63110908c86214bf76c0 (diff)
downloadvyos-1x-4419244972ad1183ae42665dd453abb19e162ed5.tar.gz
vyos-1x-4419244972ad1183ae42665dd453abb19e162ed5.zip
ddclient: T5708: Migration to 3.11.1 and related improvements
- Migrate to ddclient 3.11.1 and enforce debian/control dependency - Add dual stack support for additional protocols - Restrict usage of `porkbun` protocol, VyOS configuration structure isn't compatible with porkbun yet - Improve and cleanup error messages
Diffstat (limited to 'src/migration-scripts/dns-dynamic')
-rw-r--r--src/migration-scripts/dns-dynamic/1-to-211
1 files changed, 11 insertions, 0 deletions
diff --git a/src/migration-scripts/dns-dynamic/1-to-2 b/src/migration-scripts/dns-dynamic/1-to-2
index 8aaedf210..8b599b57a 100644
--- a/src/migration-scripts/dns-dynamic/1-to-2
+++ b/src/migration-scripts/dns-dynamic/1-to-2
@@ -18,6 +18,8 @@
# - migrate "service dns dynamic timeout ..."
# to "service dns dynamic interval ..."
# - remove "service dns dynamic address <interface> web-options ..." when <interface> != "web"
+# - migrate "service dns dynamic address <interface> service <service> protocol dnsexit"
+# to "service dns dynamic address <interface> service <service> protocol dnsexit2"
import sys
from vyos.configtree import ConfigTree
@@ -51,6 +53,15 @@ for address in config.list_nodes(address_path):
if config.exists(address_path + [address, 'web-options']) and address != 'web':
config.delete(address_path + [address, 'web-options'])
+# Migrate "service dns dynamic address <interface> service <service> protocol dnsexit"
+# to "service dns dynamic address <interface> service <service> protocol dnsexit2"
+for address in config.list_nodes(address_path):
+ for svc_cfg in config.list_nodes(address_path + [address, 'service']):
+ if config.exists(address_path + [address, 'service', svc_cfg, 'protocol']):
+ protocol = config.return_value(address_path + [address, 'service', svc_cfg, 'protocol'])
+ if protocol == 'dnsexit':
+ config.set(address_path + [address, 'service', svc_cfg, 'protocol'], 'dnsexit2')
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())