gluon-client-bridge: use new gluon.site library to avoid 'or {}' syntax

This commit is contained in:
Matthias Schiffer 2017-08-08 13:50:03 +02:00
parent 1d6e6726d7
commit eef3bba123
No known key found for this signature in database
GPG Key ID: 16EF3F64CB201D9C
2 changed files with 5 additions and 5 deletions

View File

@ -1,13 +1,13 @@
#!/usr/bin/lua
local client_bridge = require 'gluon.client_bridge'
local site = require 'gluon.site_config'
local site = require 'gluon.site'
local sysconfig = require 'gluon.sysconfig'
local uci = require('simple-uci').cursor()
local next_node = site.next_node or {}
local next_node = site.next_node({})
uci:delete('network', 'local_node_dev')
@ -23,7 +23,7 @@ uci:section('network', 'device', 'local_node_dev', {
local ip4, ip6
if next_node.ip4 then
local plen = site.prefix4:match('/%d+$')
local plen = site.prefix4():match('/%d+$')
ip4 = next_node.ip4 .. plen
end

View File

@ -1,8 +1,8 @@
local site = require 'gluon.site_config'
local site = require 'gluon.site'
module 'gluon.client_bridge'
function next_node_macaddr()
return (site.next_node or {}).mac or '16:41:95:40:f7:dc'
return site.next_node.mac('16:41:95:40:f7:dc')
end