OC-PsychOS/modules/util/fs-automount.lua

21 lines
630 B
Lua

do
local C=0
for c in component.list("filesystem") do
if c == computer.tmpAddress() then
fs.mount("tmp",component.proxy(c))
print(c:sub(1,8).." mounted as tmp")
end
if c == computer.getBootAddress() then
fs.mount("boot",component.proxy(c))
print(c:sub(1,8).." mounted as boot")
end
if component.invoke(c,"getLabel") ~= "" then
fs.mount(component.invoke(c,"getLabel"),component.proxy(c))
print(c:sub(1,8).." mounted as "..component.invoke(c,"getLabel"))
end
fs.mount("fs"..string.format("%02d",C),component.proxy(c))
print(c:sub(1,8).." mounted as fs"..string.format("%02d",C))
C=C+1
end
end