Merge pull request #254 from mkg20001/hostname-instant

This commit is contained in:
Martin Weinelt 2022-01-20 12:39:48 +01:00 committed by GitHub
commit 308166e3c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -36,6 +36,10 @@ function M.set(uci, pretty_hostname)
uci:set('system', system, 'pretty_hostname', pretty_hostname)
end
local kernel = assert(io.open('/proc/sys/kernel/hostname', 'w'))
kernel:write(hostname)
kernel:close()
uci:set('system', system, 'hostname', hostname)
end