mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 11:46:40 +00:00
15 lines
261 B
Lua
15 lines
261 B
Lua
local obj = {
|
|
hostname = nil
|
|
}
|
|
|
|
function obj.getHostname()
|
|
local f = io.popen ("hostname -s")
|
|
local hostname = f:read("*a") or ""
|
|
f:close()
|
|
hostname = string.gsub(hostname, "\n$", "")
|
|
return hostname
|
|
end
|
|
|
|
obj.hostname = obj.getHostname()
|
|
return obj
|