diff --git a/package/gluon-core/luasrc/lib/gluon/upgrade/030-system b/package/gluon-core/luasrc/lib/gluon/upgrade/030-system index 7d8eeda1..29432e4c 100755 --- a/package/gluon-core/luasrc/lib/gluon/upgrade/030-system +++ b/package/gluon-core/luasrc/lib/gluon/upgrade/030-system @@ -15,7 +15,7 @@ local pretty_hostname = require 'pretty_hostname' 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:save('system') diff --git a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua index d6891c5f..1becb9c1 100644 --- a/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua +++ b/package/gluon-core/luasrc/usr/lib/lua/gluon/util.lua @@ -95,6 +95,10 @@ function node_id() return string.gsub(sysconfig.primary_mac, ':', '') end +function default_hostname() + return site.hostname_prefix('') .. node_id() +end + function domain_seed_bytes(key, length) local ret = '' local v = ''