blob: c3be4d1100ce962ef0bd641a4956f7c48f934057 [file] [log] [blame] [raw]
local args = {...}
if args[1] then
local file = io.open("/etc/hostname", "w")
file:write(args[1])
file:close()
os.setenv("HOSTNAME", args[1])
os.setenv("PS1", "$HOSTNAME:$PWD# ")
else
local file = io.open("/etc/hostname")
if file then
io.write(file:read("*l"))
file:close()
end
end