This repository has been archived on 2024-04-19. You can view files and clone it, but cannot push or open issues or pull requests.
FREAX/bin/hostname

18 lines
414 B
Text
Raw Permalink Normal View History

2022-07-18 19:33:40 +02:00
local tArgs = { ... }
if #tArgs < 1 then
kerneldraw.printAppInfo("net", kernel.getHostname())
else
if tArgs[1] == "--set" then
if #tArgs >= 2 then
local hostname = tArgs[2]
for i,v in ipairs(tArgs) do
if not (i == 1 or i == 2) then
hostname = hostname .. tArgs[i]
end
end
kernel.setHostname(hostname)
end
else
kerneldraw.printAppInfo("hostname","Arguments not specified")
end
end