summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cactus.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/cactus.lua b/cactus.lua
index 17307fc..c3eb38e 100644
--- a/cactus.lua
+++ b/cactus.lua
@@ -171,4 +171,15 @@ local function loop()
os.sleep(120)
end
-mainloop()
+local function main()
+ setup()
+ while true do loop() end
+end
+
+while true do
+ local ok,err = pcall(main)
+ if not ok then print(error) end
+ os.sleep(5)
+end
+end
+