Shell script trigger using http interface

Hi

I have created a shell program, which takes a series of parameters as shown in the below code. Its working good from terminal.

My program

restorejob.sh -g <NAME> -p <Path-to-search> -r <Path-to-restore>

Its working fine from bash shell.

I want to extend this functionality like creating a http interface to this shell script. Like giving access using IP port and submit button triggering a shell script and taking the return codes over browser.

Is this possible using shell ? Do i need to use any other languages and webservices ?

Any help is much appreciated. thanks

Rakesh,

This is where you understand the idea of HyperText Markup Language Processors. I don't remember right now, but this is achievable in Shell as well.

All you get after hitting the submit button from the previous page is that all tags from the FORM tag are transfered to the next page ( used in action profile of FORM/submit ) and then you prepare your target processor ( no matter it is SHELL, HTTP language processors like PHP, Perl, Python, RoR ) and then its function start.

I would suggest, trying with a smaller script for understanding the idea. Create a small script like

#!/bin/bash
#
#
echo "I have been called with $# of Arguements with values:$@";
exit

Now place this shell script in cgi-bin directory of your virtual host and make it executable by your web-server specific user ( depend what HTTP Server you are running). edit your webpage and make the script as target placed in cgi-bin.

Keep an eye on access/error logs for your HTTP server, so that you know whats happening as well.

Keep us posted here if you need.

Regards,
Nasir