Add a package for handling upgrade-scripts speific for the WAN radio operation. This way, the config mode interface can be removed seperately from the core functionality to perform tasks on system upgrade. This can be useful when the setup-mode is removed entirely for space preservation.
		
			
				
	
	
		
			19 lines
		
	
	
		
			424 B
		
	
	
	
		
			Lua
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			424 B
		
	
	
	
		
			Lua
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/lua
 | |
| 
 | |
| local uci = require("simple-uci").cursor()
 | |
| local wireless = require 'gluon.wireless'
 | |
| 
 | |
| wireless.foreach_radio(uci, function(radio)
 | |
| 	local radio_name = radio['.name']
 | |
| 	local suffix = radio_name:match('^radio(%d+)$')
 | |
| 	local name   = "wan_" .. radio_name
 | |
| 
 | |
| 	if not uci:get('wireless', name, 'device') then
 | |
| 		return
 | |
| 	end
 | |
| 
 | |
| 	uci:set('wireless', name, 'ifname', suffix and 'wan' .. suffix)
 | |
| end)
 | |
| 
 | |
| uci:save('wireless')
 |