forked from izaya/OC-PsychOS2
made rc load and search pkgfs if a service isn't found
This commit is contained in:
parent
2fbee483b2
commit
8ae4d7b57c
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user