16 lines
No EOL
434 B
Text
16 lines
No EOL
434 B
Text
if not fs.isDir("/var") and not fs.exists("/var/log") and not fs.isDir("/var/log") then
|
|
fs.makeDir("/var")
|
|
fs.makeDir("/var/log")
|
|
end
|
|
local logger = fs.open("/var/log/shutdown", "a")
|
|
local tArgs = {...}
|
|
local logstr = tostring(os.day()).."d:"..textutils.formatTime(os.time(), true).." | "
|
|
for k,v in ipairs(tArgs) do
|
|
if k==1 then
|
|
logstr = logstr..v
|
|
else
|
|
logstr = logstr.." "..v
|
|
end
|
|
end
|
|
logger.writeLine(logstr)
|
|
logger.close() |