[PLUG] How to execute a shell script from an html web page
loneowais at gmail.com
Thu Mar 11 08:56:20 PST 2010
On Thu, Mar 11, 2010 at 10:13 PM, Abhijit Bhopatkar
<bain at devslashzero.com>wrote:
> >> Hey all,
> >> I wish to execute a shell script from a simple html page. When I
> >> on a submit button on the html page the script should execute. How do I
> >> this? Any help is appriciated...
> > Most langs have something like a SYSTEM() function.
> > Like in python
> > import os
> > os.system(" sh ~path-to-your-script ")
> > that should do it.
> Be careful though,
> if the script runs with priviledges an "rm -rf /" will be devestating.
> And anybody with http access will be able to carry it out.
> A less damaging part will be wiping out whatever the web server has
> access to do.
> Side point: The command executed this way will inherit web server's
> privileges. (unless suid bit is set on the execs ... but everyone
> knows not to do that).
> Pune GNU/Linux Users Group Mailing List
See if your webserver offers an API. Webfaction has a XML-RPC API. I
actually use it to run a couple of script thought my blog.
hello at owaislone.org
More information about the plug-mail