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/bin/tpm-list

30 lines
974 B
Text
Raw Permalink Normal View History

2022-07-18 19:33:40 +02:00
local tArgs = {...}
local packages = config.load("/etc/tpm/package.dat")
local packageInstalled = config.load("/etc/tpm/packageInstalled.dat")
if not security.getSU() then
exception.throw("RestrictedOpsException")
return
end
if not packages then
kerneldraw.printAppInfo("tpm", "package.dat is missing or corrupt")
log.writeMessage("package.dat unable to be traversed")
return
elseif not packageInstalled then
shell.executeScript("/etc/scripts/tpm-recache.tsf")
end
if search.findValue(tArgs, "available") then
kerneldraw.printAppInfo("tpm", "Traversing package.dat")
for k, v in pairs(packages) do
kerneldraw.printAppInfo("tpm", "Found package identifier "..v.name)
end
elseif search.findValue(tArgs, "installed") then
kerneldraw.printAppInfo("tpm", "Traversing packageInstalled.dat")
for k, v in pairs(packageInstalled) do
kerneldraw.printAppInfo("tpm", "Found package identifier "..v)
end
else
kerneldraw.printAppInfo("tpm", "Specify listing type")
end