1
0
mirror of https://github.com/freifunk-gluon/packages.git synced 2024-06-15 11:43:55 +02:00

pretty-hostname: instantly apply hostname

This makes it work like the CLI
This commit is contained in:
Maciej Krüger 2022-01-20 11:05:35 +01:00
parent 52d7ac4aea
commit 5bca0364d0
No known key found for this signature in database
GPG Key ID: 0D948CE19CF49C5F

View File

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