manman
This commit is contained in:
parent
270249922a
commit
580a78fd1d
@ -145,14 +145,6 @@ if uci:get_bool('gluon-manman-sync', 'sync', 'enabled') then
|
|||||||
return 0
|
return 0
|
||||||
end
|
end
|
||||||
|
|
||||||
local owner = uci:get_first('gluon-node-info', 'owner')
|
|
||||||
uci:set('gluon-node-info', owner, 'contact', location.administrator.email)
|
|
||||||
local _location = uci:get_first('gluon-node-info', 'location')
|
|
||||||
uci:set('gluon-node-info', _location, 'share_location', '1')
|
|
||||||
uci:set('gluon-node-info', _location, 'latitude', location.location.lat)
|
|
||||||
uci:set('gluon-node-info', _location, 'longitude', location.location.long)
|
|
||||||
|
|
||||||
|
|
||||||
local local_router_id
|
local local_router_id
|
||||||
for id, _ in string.split(hostname, '-') do
|
for id, _ in string.split(hostname, '-') do
|
||||||
if id then
|
if id then
|
||||||
@ -183,12 +175,19 @@ if uci:get_bool('gluon-manman-sync', 'sync', 'enabled') then
|
|||||||
return 2
|
return 2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
print('Syncing data for node ' .. node.name)
|
||||||
|
|
||||||
if hostname ~= should_hostname then
|
if hostname ~= should_hostname then
|
||||||
print('Renaming node to ' .. should_hostname)
|
print('Renaming node to ' .. should_hostname)
|
||||||
pretty_hostname.set(uci, should_hostname)
|
pretty_hostname.set(uci, should_hostname)
|
||||||
end
|
end
|
||||||
|
|
||||||
print('Syncing data for node ' .. node.name)
|
local owner = uci:get_first('gluon-node-info', 'owner')
|
||||||
|
uci:set('gluon-node-info', owner, 'contact', location.administrator.email)
|
||||||
|
local _location = uci:get_first('gluon-node-info', 'location')
|
||||||
|
uci:set('gluon-node-info', _location, 'share_location', '1')
|
||||||
|
uci:set('gluon-node-info', _location, 'latitude', location.location.lat)
|
||||||
|
uci:set('gluon-node-info', _location, 'longitude', location.location.long)
|
||||||
|
|
||||||
-- TODO: compare device
|
-- TODO: compare device
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user