gluon-client-bridge: use new gluon.site library to avoid 'or {}' syntax
This commit is contained in:
parent
1d6e6726d7
commit
eef3bba123
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user