aboutsummaryrefslogtreecommitdiffstats
path: root/Controller-afb/ctl-lua.c
diff options
context:
space:
mode:
authorFulup Ar Foll <fulup@iot.bzh>2017-08-20 17:16:28 +0200
committerFulup Ar Foll <fulup@iot.bzh>2017-08-20 17:16:28 +0200
commitd51d083be8e34000cd00ce979445eacb45a16e97 (patch)
treef049458d72b7c6ebe7bea10770f48db1adfc0646 /Controller-afb/ctl-lua.c
parentc58b7ea33694ab8c76f8cb452d3b8928eb3279ad (diff)
Updated to latest App Template
Diffstat (limited to 'Controller-afb/ctl-lua.c')
-rw-r--r--Controller-afb/ctl-lua.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/Controller-afb/ctl-lua.c b/Controller-afb/ctl-lua.c
index 4ef6b65..3f45055 100644
--- a/Controller-afb/ctl-lua.c
+++ b/Controller-afb/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");