Corbinhol

Autorun

Aug 3rd, 2024 (edited)
497
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.61 KB | None | 0 0
  1. local filesystem = require("filesystem");
  2. local serialization = require("serialization");
  3. local shouldRun = false;
  4.  
  5. if filesystem.exists("/usr/CM_Automator/launcher-config.cfg") then
  6.     local file = io.open("/usr/CM_Automator/launcher-config.cfg");
  7.     settings = serialization.unserialize(file:read("*a"));
  8.     shouldRun = settings["autostart"];
  9.     if shouldRun == nil then
  10.         shouldRun = false;
  11.         print("[Autostart] Error loading configuration file.");
  12.     end
  13.     file:close();
  14. else
  15.     print("[Autostart] Configuration file not found.");
  16. end
  17.  
  18. if shouldRun then
  19.     os.execute("cmauto");
  20. end
  21.  
Advertisement
Add Comment
Please, Sign In to add comment