gluon-core: add default_hostname helper
This commit is contained in:
parent
a5cb34bdc1
commit
9f86bf3155
@ -15,7 +15,7 @@ local pretty_hostname = require 'pretty_hostname'
|
|||||||
|
|
||||||
local system = uci:get_first('system', 'system')
|
local system = uci:get_first('system', 'system')
|
||||||
|
|
||||||
pretty_hostname.set(uci, site.hostname_prefix('') .. util.node_id())
|
pretty_hostname.set(uci, util.default_hostname())
|
||||||
uci:set('system', system, 'timezone', site.timezone())
|
uci:set('system', system, 'timezone', site.timezone())
|
||||||
|
|
||||||
uci:save('system')
|
uci:save('system')
|
||||||
|
@ -95,6 +95,10 @@ function node_id()
|
|||||||
return string.gsub(sysconfig.primary_mac, ':', '')
|
return string.gsub(sysconfig.primary_mac, ':', '')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function default_hostname()
|
||||||
|
return site.hostname_prefix('') .. node_id()
|
||||||
|
end
|
||||||
|
|
||||||
function domain_seed_bytes(key, length)
|
function domain_seed_bytes(key, length)
|
||||||
local ret = ''
|
local ret = ''
|
||||||
local v = ''
|
local v = ''
|
||||||
|
Loading…
Reference in New Issue
Block a user