From 31976c242d68536bd92fec19e1832efdb6bb23cc Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 3 Sep 2014 20:37:17 +0200 Subject: [PATCH] mesh-vpn-fastd: enable from site.conf This patch allows fastd's enabled flag's default value to be set from site.conf. --- gluon/gluon-mesh-vpn-fastd/check_site.lua | 1 + .../mesh-vpn-fastd/initial/010-mesh-vpn-fastd | 14 ++++++++++++++ 2 files changed, 15 insertions(+) create mode 100755 gluon/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/mesh-vpn-fastd/initial/010-mesh-vpn-fastd diff --git a/gluon/gluon-mesh-vpn-fastd/check_site.lua b/gluon/gluon-mesh-vpn-fastd/check_site.lua index 6c81713..fc9d822 100644 --- a/gluon/gluon-mesh-vpn-fastd/check_site.lua +++ b/gluon/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) diff --git a/gluon/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/mesh-vpn-fastd/initial/010-mesh-vpn-fastd b/gluon/gluon-mesh-vpn-fastd/files/lib/gluon/upgrade/mesh-vpn-fastd/initial/010-mesh-vpn-fastd new file mode 100755 index 0000000..4beb714 --- /dev/null +++ b/gluon/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')