summaryrefslogtreecommitdiff
path: root/src/migration-scripts
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-03 18:22:55 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-03 19:55:22 +0100
commit01e3d935a34f38e48364724da1cad7cbbb18576e (patch)
tree4c51edde25c05e215b2ed96a01764fe610bbaf51 /src/migration-scripts
parentf8e6d879e7491049b8f634351258a37bbe603590 (diff)
downloadvyos-1x-01e3d935a34f38e48364724da1cad7cbbb18576e.tar.gz
vyos-1x-01e3d935a34f38e48364724da1cad7cbbb18576e.zip
wireless: T3042: move wifi-regulatory-domain into individual interface definition
Diffstat (limited to 'src/migration-scripts')
-rwxr-xr-xsrc/migration-scripts/interfaces/13-to-1412
1 files changed, 11 insertions, 1 deletions
diff --git a/src/migration-scripts/interfaces/13-to-14 b/src/migration-scripts/interfaces/13-to-14
index 545b57ab2..fc6d7f443 100755
--- a/src/migration-scripts/interfaces/13-to-14
+++ b/src/migration-scripts/interfaces/13-to-14
@@ -14,7 +14,8 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Rename Wireless interface security mode 'both' to 'wpa+wpa2'
+# T3043: rename Wireless interface security mode 'both' to 'wpa+wpa2'
+# T3043: move "system wifi-regulatory-domain" to indicidual wireless interface
import os
@@ -36,6 +37,12 @@ if __name__ == '__main__':
# Nothing to do
exit(0)
+ country_code = ''
+ cc_cli = ['system', 'wifi-regulatory-domain']
+ if config.exists(cc_cli):
+ country_code = config.return_value(cc_cli)
+ config.delete(cc_cli)
+
for wifi in config.list_nodes(base):
sec_mode = base + [wifi, 'security', 'wpa', 'mode']
if config.exists(sec_mode):
@@ -43,6 +50,9 @@ if __name__ == '__main__':
if mode == 'both':
config.set(sec_mode, value='wpa+wpa2', replace=True)
+ if country_code:
+ config.set(base + [wifi, 'country-code'], value=country_code)
+
try:
with open(file_name, 'w') as f:
f.write(config.to_string())