14.05.2020, 07:55
What Daniel posted will work but you will have to reboot for hostname to change. You should also write to hostname file in order to change it right away:
Code:
io.writefile('/proc/sys/kernel/hostname', 'myhostname')