Files
opus-apps/openos/hostname.lua
kepler155c@gmail.com 426c856dfb refactor parallel code
2019-04-05 17:32:22 -04:00

18 lines
312 B
Lua

local os = _G.os
local shell = require("openos.shell")
local args = shell.parse(...)
local hostname = args[1]
if hostname then
os.setComputerLabel(hostname)
else
hostname = os.getComputerLabel()
if hostname then
print(hostname)
else
io.stderr:write("Hostname not set\n")
return 1
end
end