forked from hkc/cc-stuff
1
0
Fork 0
cc-stuff/mess/ramfsd.lua

22 lines
502 B
Lua
Raw Normal View History

peripheral.find("modem", function(name)
rednet.open(name)
print("Opened modem " .. name .. " for rednet connections")
end)
print("Hostname: " .. os.getComputerLabel())
print("ID: " .. os.getComputerID())
rednet.host("ramfs", os.getComputerLabel())
parallel.waitForAll(function()
while true do
local ev = { os.pullEvent() }
if ev[1] == "ramfs:shutdown" then
break
end
print(table.unpack(ev))
end
end, function() -- Shutdown routine
os.pullEvent("ramfs:shutdown")
end)