I was wondering what is needed to trigger a shell script with a HTTP post request. Being in my home wifi I want to call http://ip.of.host/req?run and have a script triggered on my host. I guess I have to run a webserver on the host. But what else is needed in addition? Is this the right place to ask that kind of question? Thanks!
This is a very broad question. I would install Apache and PHP on the server and then you can use a very simple PHP script to run the script. Nothing else should be required.
In your web root directory, place a script and a php file:
Run this using
You can then run any script you want (you should not place it in your web root!)
If you only want to run this on an HTTP Post request, then wrap the script in
And you can check for Post parameters with
Note: There are many caveats with this, but they are better addressed as separate questions. This should get you going, anyway.