gluon/package/gluon-mesh-vpn-fastd/luasrc/lib/gluon/upgrade/410-mesh-vpn-fastd-generate-secret
Matthias Schiffer 6cf03bab37
treewide: replace normal uses of luci.model.uci with simple-uci to reduce LuCI dependencies
We also make use of the boolean support of simple-uci to make scripts
clearer.
2017-02-10 02:10:01 +01:00

13 lines
255 B
Lua
Executable File

#!/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