diff --git a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd b/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd index 4d56be2a..5fed1e8c 100755 --- a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd +++ b/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/400-mesh-vpn-fastd @@ -9,6 +9,11 @@ local uci = require('simple-uci').cursor() local syslog_level = uci:get('fastd', 'mesh_vpn', 'syslog_level') or 'verbose' +local secret = uci:get('fastd', 'mesh_vpn', 'secret') +if not secret or not secret:match(('%x'):rep(64)) then + secret = 'generate' +end + local methods if site.mesh_vpn.fastd.configurable(false) then @@ -38,6 +43,7 @@ end uci:section('fastd', 'fastd', 'mesh_vpn', { group = 'gluon-mesh-vpn', syslog_level = syslog_level, + secret = secret, interface = vpn_core.get_interface(), mode = 'tap', mtu = site.mesh_vpn.mtu(), diff --git a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret b/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret deleted file mode 100755 index f43e8b1f..00000000 --- a/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret +++ /dev/null @@ -1,12 +0,0 @@ -#!/usr/bin/lua - -local uci = require 'simple-uci' - -local c = uci.cursor() - -local secret = c:get("fastd", "mesh_vpn", "secret") - -if not secret or not secret:match(("%x"):rep(64)) then - c:set("fastd", "mesh_vpn", "secret", "generate") - c:save("fastd") -end