gluon/package/gluon-client-bridge/files/lib/gluon/upgrade/300-gluon-client-bridge-network
Nils Schneider 84b6374970 gluon-client-bridge: basic br-client config and wireless AP
This package provides br-client and sets up a wireless AP interface for
clients.
2015-10-26 21:14:32 +01:00

28 lines
582 B
Lua
Executable File

#!/usr/bin/lua
local sysconfig = require 'gluon.sysconfig'
local uci = require('luci.model.uci').cursor()
if not uci:get('network', 'client') then
uci:section('network', 'interface', 'client',
{
type = 'bridge',
}
)
end
local ifname = uci:get('network', 'client', 'ifname')
if type(ifname) == 'string' then
uci:delete('network', 'client', 'ifname')
for x in ifname:gmatch("[^%s]+") do
uci:add_to_set('network', 'client', 'ifname', x)
end
end
uci:set('network', 'client', 'macaddr', sysconfig.primary_mac)
uci:save('network')
uci:commit('network')