mirror of
https://github.com/kernelkit/infix.git
synced 2026-08-02 05:43:02 +02:00
confd: minor, use initial hostname from /etc/os-release as fallback
Instead of hard-coding the fallback hostname we can now use the one generated to /etc/os-release (for netbrowse). Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
committed by
Tobias Waldekranz
parent
a05e28d349
commit
ab21eff6c8
@@ -1326,8 +1326,9 @@ static int change_hostname(sr_session_ctx_t *session, uint32_t sub_id, const cha
|
||||
|
||||
nm = srx_get_str(session, "%s", xpath);
|
||||
if (!nm) {
|
||||
/* XXX: derive from global "options.h" or /usr/share/factory/ */
|
||||
nm = strdup("infix");
|
||||
nm = fgetkey("/etc/os-release", "DEFAULT_HOSTNAME");
|
||||
if (nm)
|
||||
nm = strdup(nm);
|
||||
if (!nm) {
|
||||
err = SR_ERR_NO_MEMORY;
|
||||
goto err;
|
||||
|
||||
Reference in New Issue
Block a user