From 84bd8874ffbd2ee0832135fb2a631832d8328160 Mon Sep 17 00:00:00 2001 From: Skye Date: Mon, 14 Aug 2017 11:59:29 +0100 Subject: [PATCH] Simple rc file for autostarting `occure` on OpenOS Basic testing shows that this works, and this seems to be the official way to get programs started at boot on OpenOS. --- oc/occure_rc.lua | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 oc/occure_rc.lua diff --git a/oc/occure_rc.lua b/oc/occure_rc.lua new file mode 100644 index 0000000..45f204a --- /dev/null +++ b/oc/occure_rc.lua @@ -0,0 +1,22 @@ +--[[ +To the extent possible under law, Skye has waived all copyright and related or neighboring rights to this file. This file is published from: United Kingdom. +--]] + +-- This file goes into /etc/rc.d +-- To set this to autostart, it must be added to the enabled list +-- The hostname must be set using `occure = "your_hostname_here"` + +function start(hostname) + if type(hostname) == 'table' then + hostname = hostname[1] + end + + local shell = require('shell') + local occure = shell.resolve('occure', 'lua') + if occure then + local ok, res = shell.execute(occure, _G, args) + if not ok then + error(res) + end + end +end