From 8ae4d7b57c18b7788b223a7220c8759021ae09c3 Mon Sep 17 00:00:00 2001 From: XeonSquared Date: Sun, 7 Jun 2020 23:35:24 +1000 Subject: [PATCH] made rc load and search pkgfs if a service isn't found --- lib/rc.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/rc.lua b/lib/rc.lua index 7bc197a..e4f1f52 100644 --- a/lib/rc.lua +++ b/lib/rc.lua @@ -29,7 +29,12 @@ function rc.load(name,force) -- string boolean -- table -- Attempts to load serv end if service[name] then return true end service[name] = setmetatable({},{__index=_G}) - local f = io.open("/boot/service/"..name..".lua","rb") or io.open("/pkg/service/"..name..".lua","rb") + local f + f = io.open("/boot/service/"..name..".lua","rb") + if not f then + pcall(require,"pkgfs") + f = io.open("/pkg/service/"..name..".lua","rb") + end local res = load(f:read("*a"),name,"t",service[name])() f:close() return res