mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
loader: Fetch initial script from loader_lua env
Sometimes it is nice to override the initial script that we run. Make it possible by fetching loader_lua from the env and using that instead of the default if prsent. Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D43819 (cherry picked from commit cd147a2a024301a796f307c7bae686305d2bf302)
This commit is contained in:
parent
3601f43978
commit
8ea26f3280
1 changed files with 3 additions and 1 deletions
|
|
@ -123,7 +123,9 @@ interp_init(void)
|
|||
lua_pop(luap, 1); /* remove lib */
|
||||
}
|
||||
|
||||
filename = LOADER_LUA;
|
||||
filename = getenv("loader_lua");
|
||||
if (filename == NULL)
|
||||
filename = LOADER_LUA;
|
||||
if (interp_include(filename) != 0) {
|
||||
const char *errstr = lua_tostring(luap, -1);
|
||||
errstr = errstr == NULL ? "unknown" : errstr;
|
||||
|
|
|
|||
Loading…
Reference in a new issue