On Thu, Mar 11, 2010 at 10:13 PM, Abhijit Bhopatkar
<[email protected]>wrote:
> >> Hey all,
> >> I wish to execute a shell script from a simple html page. When I
> click
> >> on a submit button on the html page the script should execute. How do I
> do
> >> 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).
>
> Abhijit
>
> _______________________________________
> 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.
--
Owais Lone
[email protected]
http://www.owaislone.org
_______________________________________
Pune GNU/Linux Users Group Mailing List