private-ap: init
This commit is contained in:
		
							parent
							
								
									f64e274c4e
								
							
						
					
					
						commit
						185d57f458
					
				
							
								
								
									
										12
									
								
								package/gluon-private-ap/Makefile
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								package/gluon-private-ap/Makefile
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,12 @@ | |||||||
|  | include $(TOPDIR)/rules.mk | ||||||
|  | 
 | ||||||
|  | PKG_NAME:=gluon-private-ap | ||||||
|  | 
 | ||||||
|  | include ../gluon.mk | ||||||
|  | 
 | ||||||
|  | define Package/gluon-private-ap | ||||||
|  |   TITLE:=Provides a virtual access point for the nodes client network | ||||||
|  |   DEPENDS:=+gluon-core | ||||||
|  | endef | ||||||
|  | 
 | ||||||
|  | $(eval $(call BuildPackageGluon,gluon-private-ap)) | ||||||
							
								
								
									
										18
									
								
								package/gluon-private-ap/luasrc/lib/gluon/upgrade/325-gluon-private-ap
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										18
									
								
								package/gluon-private-ap/luasrc/lib/gluon/upgrade/325-gluon-private-ap
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,18 @@ | |||||||
|  | #!/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   = "ap_" .. 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') | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user