Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local address = ...
- local countFile = "/tmp/hddCount"
- local mountName = "/hdd"
- if fs.exists(countFile) then
- local fileHandle = io.open(countFile,"r")
- local currentCount = tonumber(fileHandle:read("*a"))
- fileHandle:close()
- fs.mount(address,mountName..currentCount+1)
- local fileHandle = io.open(countFile,"w")
- fileHandle:write(tostring(currentCount+1))
- fileHandle:close()
- else
- local fileHandle = io.open(countFile,"w")
- fileHandle:write("0")
- fileHandle:close()
- fs.mount(address,mountName.."0")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement