gluon-mesh-vpn-tunneldigger: add package for tunneldigger L2TP support
This commit is contained in:
parent
be88eba07f
commit
ad7a36fdce
38
package/gluon-mesh-vpn-tunneldigger/Makefile
Normal file
38
package/gluon-mesh-vpn-tunneldigger/Makefile
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
include $(TOPDIR)/rules.mk
|
||||||
|
|
||||||
|
PKG_NAME:=gluon-mesh-vpn-tunneldigger
|
||||||
|
PKG_VERSION:=3
|
||||||
|
|
||||||
|
PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
|
||||||
|
|
||||||
|
include ../gluon.mk
|
||||||
|
|
||||||
|
define Package/gluon-mesh-vpn-tunneldigger
|
||||||
|
SECTION:=gluon
|
||||||
|
CATEGORY:=Gluon
|
||||||
|
TITLE:=Support for connecting meshes via tunneltigger/L2TPv3 pseudowire
|
||||||
|
DEPENDS:=+gluon-core +gluon-mesh-vpn-core +tunneldigger
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Prepare
|
||||||
|
mkdir -p $(PKG_BUILD_DIR)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Configure
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Build/Compile
|
||||||
|
$(call GluonSrcDiet,./luasrc,$(PKG_BUILD_DIR)/luadest/)
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/gluon-mesh-vpn-tunneldigger/install
|
||||||
|
$(CP) ./files/* $(1)/
|
||||||
|
$(CP) $(PKG_BUILD_DIR)/luadest/* $(1)/
|
||||||
|
endef
|
||||||
|
|
||||||
|
define Package/gluon-mesh-vpn-tunneldigger/postinst
|
||||||
|
#!/bin/sh
|
||||||
|
$(call GluonCheckSite,check_site.lua)
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(call BuildPackage,gluon-mesh-vpn-tunneldigger))
|
1
package/gluon-mesh-vpn-tunneldigger/check_site.lua
Normal file
1
package/gluon-mesh-vpn-tunneldigger/check_site.lua
Normal file
@ -0,0 +1 @@
|
|||||||
|
need_string_array('mesh_vpn.tunneldigger.brokers')
|
@ -0,0 +1,32 @@
|
|||||||
|
#!/usr/bin/lua
|
||||||
|
|
||||||
|
local site = require 'gluon.site_config'
|
||||||
|
local util = require 'gluon.util'
|
||||||
|
|
||||||
|
local uci = require('simple-uci').cursor()
|
||||||
|
|
||||||
|
|
||||||
|
local enabled = uci:get('tunneldigger', 'mesh_vpn', 'enabled')
|
||||||
|
if enabled == nil then
|
||||||
|
enabled = uci:get_first('tunneldigger', 'broker', 'enabled')
|
||||||
|
end
|
||||||
|
if enabled == nil then
|
||||||
|
enabled = site.mesh_vpn.enabled or false
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Delete old broker config section
|
||||||
|
if not uci:get('tunneldigger', 'mesh_vpn') then
|
||||||
|
uci:delete_all('tunneldigger', 'broker')
|
||||||
|
end
|
||||||
|
|
||||||
|
uci:section('tunneldigger', 'broker', 'mesh_vpn', {
|
||||||
|
enabled = enabled,
|
||||||
|
uuid = util.node_id(),
|
||||||
|
interface = 'mesh-vpn',
|
||||||
|
bind_interface = 'br-wan',
|
||||||
|
group = 'gluon-mesh-vpn',
|
||||||
|
broker_selection = 'usage',
|
||||||
|
address = site.mesh_vpn.tunneldigger.brokers,
|
||||||
|
})
|
||||||
|
|
||||||
|
uci:save('tunneldigger')
|
Loading…
Reference in New Issue
Block a user