diff options
author | Felix Fietkau <nbd@openwrt.org> | 2013-01-04 23:14:07 +0100 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2013-01-04 23:14:07 +0100 |
commit | b949545598eaa75b38b4d57c9aea6216bd82256c (patch) | |
tree | e8716e9b8ad6fb3bec788ed7f78c332284f1934c /main.c | |
parent | 0e7c0877717534db5ecac58df9f01c60776e85db (diff) |
add lua plugin support
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -329,6 +329,15 @@ int main(int argc, char **argv) case 'K': tls_key = optarg; break; +#ifdef HAVE_LUA + case 'l': + conf.lua_prefix = optarg; + break; + + case 'L': + conf.lua_handler = optarg; + break; +#endif default: return usage(argv[0]); } @@ -357,6 +366,17 @@ int main(int argc, char **argv) #endif } +#ifdef HAVE_LUA + if (conf.lua_handler || conf.lua_prefix) { + if (!conf.lua_handler || !conf.lua_prefix) { + fprintf(stderr, "Need handler and prefix to enable Lua support\n"); + return 1; + } + if (uh_plugin_init("uhttpd_lua.so")) + return 1; + } +#endif + /* fork (if not disabled) */ if (!nofork) { switch (fork()) { |