diff options
author | Marcus Hoff <marcus.hoff@ring2.dk> | 2020-09-26 13:19:37 +0200 |
---|---|---|
committer | Marcus Hoff <marcus.hoff@ring2.dk> | 2020-09-26 13:19:37 +0200 |
commit | 1141bee72677b25d18436975625d2d298be503ff (patch) | |
tree | 4b6dc8fe1a8ced931e1ba08c58a348abfcd85a6b /src/migration-scripts/system/14-to-15 | |
parent | 45b30adfaaec7065f768d04085138a75a76ed376 (diff) | |
parent | 374724be64728101c262fcac1579beece63ee651 (diff) | |
download | vyos-1x-1141bee72677b25d18436975625d2d298be503ff.tar.gz vyos-1x-1141bee72677b25d18436975625d2d298be503ff.zip |
Merge remote-tracking branch 'upstream/current' into current
Diffstat (limited to 'src/migration-scripts/system/14-to-15')
-rwxr-xr-x | src/migration-scripts/system/14-to-15 | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/migration-scripts/system/14-to-15 b/src/migration-scripts/system/14-to-15 index 2491e3d0d..c055dad1f 100755 --- a/src/migration-scripts/system/14-to-15 +++ b/src/migration-scripts/system/14-to-15 @@ -1,10 +1,14 @@ #!/usr/bin/env python3 # -# Make 'system options reboot-on-panic' valueless +# Delete 'system ipv6 blacklist' option as the IPv6 module can no longer be +# blacklisted as it is required by e.g. WireGuard and thus will always be +# loaded. import os import sys +ipv6_blacklist_file = '/etc/modprobe.d/vyatta_blacklist_ipv6.conf' + from vyos.configtree import ConfigTree if (len(sys.argv) < 1): @@ -17,17 +21,16 @@ with open(file_name, 'r') as f: config_file = f.read() config = ConfigTree(config_file) -base = ['system', 'options'] -if not config.exists(base): +ip_base = ['system', 'ipv6'] +if not config.exists(ip_base): # Nothing to do sys.exit(0) else: - if config.exists(base + ['reboot-on-panic']): - reboot = config.return_value(base + ['reboot-on-panic']) - config.delete(base + ['reboot-on-panic']) - # create new valueless node if action was true - if reboot == "true": - config.set(base + ['reboot-on-panic']) + # delete 'system ipv6 blacklist' node + if config.exists(ip_base + ['blacklist']): + config.delete(ip_base + ['blacklist']) + if os.path.isfile(ipv6_blacklist_file): + os.unlink(ipv6_blacklist_file) try: with open(file_name, 'w') as f: |