skip mounting any already mounted filesystems

This commit is contained in:
Izaya 2023-10-07 11:35:15 +10:00
parent 91d9ce33c8
commit 638322c157
1 changed files with 5 additions and 0 deletions

View File

@ -3,6 +3,11 @@ fsmanager.filesystems = {}
local run = true
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))
syslog("Mounting "..addr.." to "..dest)
fs.makeDirectory(dest)