Переглянути джерело

mesh-vpn-fastd: enable from site.conf

This patch allows fastd's enabled flag's default value to be set from
site.conf.
Nils Schneider 9 роки тому
батько
коміт
4e19df098a

+ 1 - 0
package/gluon-mesh-vpn-fastd/check_site.lua

@@ -11,3 +11,4 @@ local function check_peer(k, _)
 end
 
 need_table('fastd_mesh_vpn.backbone.peers', check_peer)
+need_boolean('fastd_mesh_vpn.enabled', false)

+ 14 - 0
package/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/mesh-vpn-fastd/initial/010-mesh-vpn-fastd

@@ -0,0 +1,14 @@
+#!/usr/bin/lua
+
+local site = require 'gluon.site_config'
+local uci = require 'luci.model.uci'
+local c = uci.cursor()
+
+c:section('fastd', 'fastd', 'mesh_vpn',
+	  {
+		  enabled = site.fastd_mesh_vpn.enabled and 1 or 0
+	  }
+)
+
+c:save('fastd')
+c:commit('fastd')