14.05.2020, 09:42
You need to run both code pieces to set both permanent and current hostname:
Code:
hostname = 'myhostname'
require('uci')
uci.set("system.@system[0].hostname=" .. hostname)
uci.commit('system')
io.writefile('/proc/sys/kernel/hostname', hostname)