[luci] Template button execute lua code

Jo-Philipp Wich xm at subsignal.org
Mon Sep 15 19:35:07 CEST 2014


Usually you'd do it like this:

<%
  if luci.http.formvalue("run_script") then
    os.execute("/path/to/script.sh >/dev/null")
  end
%>

...

<input type="submit" name="run_script" value="Run Script" />


Note that the value of the name="..." attribute and the formvalue check
must match.

~ Jow


More information about the luci mailing list