OpenWrt Forum Archive

Topic: Getting started with Lua on OpenWRT

The content of this topic has been archived on 25 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

I'm trying to setup a basic Captive Portal on OpenWRT using IPtables and LUA.
I was able to create a simple Hello World script working in /www/cgi-bin/, but I don't understand how to access server variables.

The script I'm trying to port to Lua is created by Andy Beverly:
http://www.andybev.com/index.php/Using_ … ive_portal

I don't like the idea of getting PHP to OpenWRT and I think this should be able to work in Lua.
Any pointers or tips are welcome.

Also, I think this might be a nice add-on for OpenWRT. I've not seen a light weight Captive Portal yet for OpenWRT.

Thanks.
Stu.

Yeah I know about NoDogSplash, but it's only a splash screen, there's no accounting done here.
True, the script I linked to is very simple, but at least it gives me some level of control on who uses it.

Anyone?

Let me make the question a bit more specific.
What is the equivalent in Lua of PHP variables such as $_SERVER['REMOTE_ADDR'], $_SERVER['REQUEST_URI']?

Thanks!

The discussion might have continued from here.