hostname - Printable Version +- Logic Machine Forum (https://forum.logicmachine.net) +-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1) +--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8) +--- Thread: hostname (/showthread.php?tid=963) |
hostname - domotiqa - 24.08.2017 Hello, is it possible to have the hostname of the lmachine by script something like myname= hostname RE: hostname - admin - 24.08.2017 Code: hostname = io.readfile('/proc/sys/kernel/hostname'):trim() RE: hostname - domotiqa - 25.08.2017 (24.08.2017, 17:37)admin Wrote: RE: hostname - pepe - 14.05.2020 hi, how can i write a hostname by script? io.writefile... RE: hostname - Daniel - 14.05.2020 Try this Code: ------------------------------------ RE: hostname - admin - 14.05.2020 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') RE: hostname - pepe - 14.05.2020 (14.05.2020, 07:52)Daniel. Wrote: Try this Thank but does not work, maybe it's also me (14.05.2020, 07:55)admin Wrote: 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: worked but the old name is adopted after a restart RE: hostname - Daniel - 14.05.2020 I tried it and it worked. Your browser cache? RE: hostname - admin - 14.05.2020 You need to run both code pieces to set both permanent and current hostname: Code: hostname = 'myhostname' RE: hostname - pepe - 14.05.2020 (14.05.2020, 07:52)Daniel. Wrote: Try this sorry it works! thanks forgot a sign... after the restart it will be kept |