mirror of
https://github.com/XeonSquared/OC-Copper.git
synced 2024-11-15 06:18:05 +11:00
Merge pull request #2 from skyem123/occure_rc
Simple rc file for autostarting `occure` on OpenOS
This commit is contained in:
commit
80a5edc3e4
22
oc/occure_rc.lua
Normal file
22
oc/occure_rc.lua
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user