Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local regexes = dash.flatten {
- "^P/",
- "ShutdownOS",
- "^P4/",
- registry.get "netbootd.extra_regexes"
- }
- function onsys()
- -- Ensure that nobody can easily shut down all the potatOS computers on a network.
- -- Of course, they wouldn't want to, but you know.
- while true do
- while true do
- local count = 0
- for _, name in pairs(peripheral.getNames()) do
- if peripheral.getType(name) == "computer" then
- local l = peripheral.call(name, "getLabel")
- if l and (l:match "^P/" or l:match "ShutdownOS" or l:match "^P4/") and not peripheral.call(name, "isOn") then
- peripheral.call(name, "turnOn")
- count = count + 1
- end
- end
- end
- sleep(1 + math.random(0, count))
- end
- end
- end
- return {
- name = "netbootd",
- async = onsys
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement