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/sbin/asm-reload

44 lines
1.1 KiB
Text
Raw Normal View History

2022-07-18 19:33:40 +02:00
local tArgs = {...}
local err = true
local sil = false
local function findArg(arg)
for _,v in ipairs(tArgs) do
if v == arg then
return true
end
end
return false
end
if findArg("-s") or findArg("--silent") then
sil = true
end
if findArg("-c:SYSTEM_CACHE") or findArg("--cache:SYSTEM_CACHE") then
err = false
if not sil then
kerneldraw.printBootInfo("Reloading system library cache")
kerneldraw.printBootWarning("Loading system libraries")
else
kernel.writeSyslog("Reloading system library cache")
kernel.writeSyslog("Loading system libraries")
end
kernel.loadSysLibs()
end
if findArg("-c:USER_CACHE") or findArg("--cache:USER_CACHE") then
err = false
if not sil then
kerneldraw.printBootInfo("Reloading user library cache")
kerneldraw.printBootWarning("Loading user libraries")
else
kernel.writeSyslog("Reloading user library cache")
kernel.writeSyslog("Loading user libraries")
end
kernel.loadUsrLibs()
end
if #tArgs < 1 then
kerneldraw.printAppInfo("asm-reload", "Arguments not specified")
return
elseif err then
kerneldraw.printAppInfo("asm-reload", "Specify cache to reload")
return
end