#!/usr/bin/lua

local site = require 'gluon.site'
local util = require 'gluon.util'
local uci = require('simple-uci').cursor()


-- fix up potentially duplicate MAC addresses (for meshing)
if not site.mesh.vxlan(true) then
	uci:set('network', 'wan', 'macaddr', util.generate_mac(0))
else
	uci:delete('network', 'wan', 'macaddr')
end
uci:set('network', 'mesh_lan', 'macaddr', util.generate_mac(4))
uci:save('network')
