Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ftr = {}
- functr = {}
- os.loadAPI("/lib/thread")
- for i, k in pairs(fs.list("/etc/systemd")) do
- file = fs.open("/etc/systemd/"..k, "r")
- if file.readLine() == "[STARTUP]" then
- ftr[k] = file.readLine()
- file.close()
- end
- end
- for i, k in pairs(ftr) do
- thr = thread.create(k)
- if not coroutine.status(thr) == "dead" then
- term.write("[")
- term.setTextColor(colors.lime)
- term.write("OK")
- term.setTextColor(colors.white)
- term.write("] ")
- term.write("Avviato "..i.." da "..k)
- else
- term.write("[")
- term.setTextColor(colors.red)
- term.write("FAIL")
- term.setTextColor(colors.white)
- term.write("] ")
- term.write("Avvio non riuscito di "..i.." da "..k)
- end
- end
- sleep(1)
- term.clear()
- term.setCursorPos(1, 1)
- shell.run("/bin/bash")
Advertisement
Add Comment
Please, Sign In to add comment