Posted: Sun Mar 10, 2019 14:43 Post subject: lighttpd - how to make html button trigger a script?
So i have lighttpd on my router hosting a very simple webpage. Whats the easiest/best way to have a button on the page that triggers a script execution on the router?
Right now I have a simple html button ( using form method="get" and button type="submit" ...etc.) with an action that loads a different html file. On that other html file I have an SSI command <!--#exec cmd="/opt/my_script.sh" --> that immediately runs my_script.sh. (I have lighttpd configured to load the mod_ssi module).
This is working perfectly fine. the only annoyance is that it needs to switch html files to execute the script.
Is there a simpler way to have a button directly execute a script?
Thanks for any insights! and yes I know SSI is a relic of the 1990's, but it seems to work fine for me . Although if there is a better way to do it thats just as easy I am all ears