summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/main.c b/main.c
index 160f932..cefd4ab 100644
--- a/main.c
+++ b/main.c
@@ -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()) {