summaryrefslogtreecommitdiffstats
path: root/ctl-lua.c
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-08-20 17:16:28 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-12-13 14:57:57 +0100
commit9e8fb48bc13f3ef4848a54c7a2415cb25339fef0 (patch)
tree763615143ab69ff7da8812533e5c1e340a5b94b1 /ctl-lua.c
parentb9776b0f51b2d23584b962d1aa93d5028118fcaf (diff)
Updated to latest App Template
Diffstat (limited to 'ctl-lua.c')
-rw-r--r--ctl-lua.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ctl-lua.c b/ctl-lua.c
index 4ef6b65..3f45055 100644
--- a/ctl-lua.c
+++ b/ctl-lua.c
@@ -965,7 +965,10 @@ PUBLIC int LuaLibInit () {
strncat (fullprefix, GetBinderName(), sizeof(fullprefix));
strncat (fullprefix, "-", sizeof(fullprefix));
- json_object *luaScriptPathJ = ScanForConfig(CONTROL_LUA_PATH , CTL_SCAN_RECURSIVE, fullprefix, "lua");
+ const char *dirList= getenv("CONTROL_LUA_PATH");
+ if (!dirList) dirList=CONTROL_LUA_PATH;
+
+ json_object *luaScriptPathJ = ScanForConfig(dirList , CTL_SCAN_RECURSIVE, fullprefix, "lua");
// open a new LUA interpretor
luaState = luaL_newstate();
@@ -1021,7 +1024,7 @@ PUBLIC int LuaLibInit () {
// no policy config found remove control API from binder
if (index == 0) {
- AFB_WARNING ("POLICY-INIT:WARNING No Control LUA file in path=[%s]", CONTROL_LUA_PATH);
+ AFB_WARNING ("POLICY-INIT:WARNING (setenv CONTROL_LUA_PATH) No LUA '%s*.lua' in '%s'", fullprefix, dirList);
}
AFB_DEBUG ("Audio control-LUA Init Done");