skip mounting any already mounted filesystems

This commit is contained in:
Izaya 2023-10-07 11:35:15 +10:00
parent 91d9ce33c8
commit 638322c157

View File

@ -3,6 +3,11 @@ fsmanager.filesystems = {}
local run = true local run = true
function fsmanager.mount(addr) function fsmanager.mount(addr)
for k,v in ipairs(fs.mounts()) do
if fs.address(v) == addr then
return
end
end
dest = "/" .. (component.invoke(addr,"getLabel") or "mnt/"..addr:sub(1,3)) dest = "/" .. (component.invoke(addr,"getLabel") or "mnt/"..addr:sub(1,3))
syslog("Mounting "..addr.." to "..dest) syslog("Mounting "..addr.." to "..dest)
fs.makeDirectory(dest) fs.makeDirectory(dest)