This repository has been archived on 2024-04-19. You can view files and clone it, but cannot push or open issues or pull requests.
FREAX/etc/script_util/slog_shutdown
2022-07-18 19:33:40 +02:00

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()