Posts: 256
Threads: 37
Joined: Feb 2016
Reputation:
1
Hello, is it possible to have the hostname of the lmachine by script
something like
myname= hostname
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT
Posts: 256
Threads: 37
Joined: Feb 2016
Reputation:
1
(24.08.2017, 17:37)admin Wrote: Code:
hostname = io.readfile('/proc/sys/kernel/hostname'):trim()
-----------
FRANCE SMARTHOME & SMARTBUILDING INTEGRATION
SE ECO EXPERT
Posts: 12
Threads: 2
Joined: Oct 2017
Reputation:
0
hi, how can i write a hostname by script?
io.writefile...
Posts: 4572
Threads: 23
Joined: Aug 2017
Reputation:
206
Try this
Code:
------------------------------------
require('uci')
uci.set("system.@system[0].hostname=name63characters")
uci.commit('system')
--------------------------------------
------------------------------
Ctrl+F5
Posts: 4572
Threads: 23
Joined: Aug 2017
Reputation:
206
I tried it and it worked. Your browser cache?
------------------------------
Ctrl+F5