summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-01-04 23:14:07 +0100
committerFelix Fietkau <nbd@openwrt.org>2013-01-04 23:14:07 +0100
commitb949545598eaa75b38b4d57c9aea6216bd82256c (patch)
treee8716e9b8ad6fb3bec788ed7f78c332284f1934c /main.c
parent0e7c0877717534db5ecac58df9f01c60776e85db (diff)
add lua plugin support
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()) {