Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- List of keywords to check for in the startup scripts
- local requiredKeywords = {
- "local requiredFiles = {",
- "/disk/bootloader/VA11-ILLA.lua",
- "/disk/os/home.lua",
- "/disk/os/lock.lua",
- "/disk/boot/boot-animation",
- "/disk/error/BSOD.lua",
- "os.pullEvent = os.pullEventRaw",
- "local function checkFiles()",
- "local function main()",
- "shell.run(\"no-os\")",
- "shell.run(\"/disk/boot/start-check.lua\")"
- -- Add more keywords as needed
- }
- -- Function to read a file's content
- local function readFile(path)
- if not fs.exists(path) then
- return nil
- end
- local file = fs.open(path, "r")
- local content = file.readAll()
- file.close()
- return content
- end
- -- Function to check for the presence of keywords in a script
- local function checkForKeywords(content, keywords)
- if not content then
- return false
- end
- for _, keyword in ipairs(keywords) do
- if not string.find(content, keyword, 1, true) then
- return false
- end
- end
- return true
- end
- -- Main function to compare the contents of `startup` and `startup.lua`
- local function compareStartupFiles()
- local startupContent = readFile("/startup")
- local startupLuaContent = readFile("/startup.lua")
- if checkForKeywords(startupContent, requiredKeywords) or checkForKeywords(startupLuaContent, requiredKeywords) then
- print("Success: The startup script contains all required keywords.")
- else
- print("Error: The startup script does not contain all required keywords.")
- end
- end
- -- Run the comparison function
- compareStartupFiles()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement