410-mesh-vpn-fastd-generate-secret 259 B

123456789101112
  1. #!/usr/bin/lua
  2. local uci = require 'luci.model.uci'
  3. local c = uci.cursor()
  4. local secret = c:get("fastd", "mesh_vpn", "secret")
  5. if not secret or not secret:match(("%x"):rep(64)) then
  6. c:set("fastd", "mesh_vpn", "secret", "generate")
  7. c:save("fastd")
  8. end