Skip to content
Snippets Groups Projects
Commit 335026af authored by Jan-Philipp Litza's avatar Jan-Philipp Litza
Browse files

Allow empty hostname prefix

In Bremen it has been noted that a prefix may lead people to believe it
has to stay there and thus naming their nodes "ffhb-*", which is not
what the community wants (see FreifunkBremen/gluon-site-ffhb#1).

However, an empty prefix lead to the connecting hyphen still being
inserted. This commit thus makes the hyphen part of the configured
prefix and allows the prefix to be missing from the `site.conf`.
parent 7896f91f
No related branches found
No related tags found
No related merge requests found
need_string 'site_code'
need_string 'site_name'
need_string 'hostname_prefix'
need_string('hostname_prefix', false)
need_string 'timezone'
need_string_array('ntp_servers', false)
......
......@@ -10,7 +10,7 @@ if not sysconfig.gluon_version then
local system = uci:get_first('system', 'system')
uci:set('system', system, 'hostname', site.hostname_prefix .. '-' .. util.node_id())
uci:set('system', system, 'hostname', (site.hostname_prefix or '') .. util.node_id())
uci:set('system', system, 'timezone', site.timezone)
uci:save('system')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment