gluon-simple-tc: add site validator
This commit is contained in:
		
							parent
							
								
									de633e9bc3
								
							
						
					
					
						commit
						f792997bb1
					
				| @ -1,11 +1,11 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
| 
 | ||||
| PKG_NAME:=gluon-simple-tc | ||||
| PKG_VERSION:=2 | ||||
| PKG_VERSION:=3 | ||||
| 
 | ||||
| PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME) | ||||
| 
 | ||||
| include $(INCLUDE_DIR)/package.mk | ||||
| include $(GLUONDIR)/include/package.mk | ||||
| 
 | ||||
| define Package/gluon-simple-tc | ||||
|   SECTION:=gluon | ||||
| @ -32,4 +32,9 @@ define Package/gluon-simple-tc/install | ||||
| 	$(CP) ./files/* $(1)/ | ||||
| endef | ||||
| 
 | ||||
| define Package/gluon-simple-tc/postinst | ||||
| #!/bin/sh
 | ||||
| $(call GluonCheckSite,check_site.lua) | ||||
| endef | ||||
| 
 | ||||
| $(eval $(call BuildPackage,gluon-simple-tc)) | ||||
|  | ||||
							
								
								
									
										10
									
								
								package/gluon-simple-tc/check_site.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								package/gluon-simple-tc/check_site.lua
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,10 @@ | ||||
| local function check_entry(k, _) | ||||
|    local prefix = string.format('simple_tc[%q].', k) | ||||
| 
 | ||||
|    need_string(prefix .. 'ifname') | ||||
|    need_boolean(prefix .. 'enabled') | ||||
|    need_number(prefix .. 'limit_egress') | ||||
|    need_number(prefix .. 'limit_ingress') | ||||
| end | ||||
| 
 | ||||
| need_table('simple_tc', check_entry) | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user