Shell script trigger using http interface


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Shell script trigger using http interface
# 1  
Old 05-15-2012
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
Code:
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
# 2  
Old 05-16-2012
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

Code:
#!/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

Last edited by busyboy; 05-16-2012 at 06:13 AM.. Reason: placement of script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How can i get Solaris interface ip using shell script?

HI Community, my server has more than 15 zones and each one is having virtual interface of 10G adapter (qlge0) if the filter the output of ifconfig -a | grep inet, it's showing all interfaces including virtual. i have take first like from the output and assumed that as my main ip is... (3 Replies)
Discussion started by: bentech4u
3 Replies

2. Shell Programming and Scripting

Web Interface for shell script.

Hi Team, I have daily pdf files which i have to convert in tif images. I have script which does it. I need to put these images in some specific folder (which i create manually) on server. Is there any web based way to it, so that user can simply browse file & it will convert & upload on... (1 Reply)
Discussion started by: paragnehete
1 Replies

3. UNIX for Dummies Questions & Answers

shell script to trigger an other shell script

Folks, how to trigger a shell script eg " B " from shell script eg "A" and parse different arguments to the child shell script "B" - like 0 the first time the shell script "B" is triggered and 1 the next time. Shell script A -----------> launch shell script B with an args 0... (6 Replies)
Discussion started by: venu
6 Replies

4. Shell Programming and Scripting

User interface for the shell script

Hi, I have written a shell script that does the job of downloading a build file and upgrading a application on my test linux system. This shell is a interactive script where the user needs to enter certain info like the remote system on which the upgrade has to be performed and the build number... (2 Replies)
Discussion started by: sunrexstar
2 Replies

5. Shell Programming and Scripting

Execute shell script from plsql trigger

Hi, I have been assigned a job which requires me to send mails from unix(Mailx) upon on certain actions triggered in the database. On insert/update of a certain field into one of the database tables the shell script present in Unix box responsible to send mail though mailx needs to be triggered... (7 Replies)
Discussion started by: hemant.bs11
7 Replies

6. Shell Programming and Scripting

How to trigger workflow manager through shell script?

I am new to siebel workflow manager. Can anyone help me regarding the shell script which will trigger siebel workflow manager. I want a sample shell script to trigger workflow manager. Thanks in advance. (2 Replies)
Discussion started by: siri_886
2 Replies

7. UNIX for Dummies Questions & Answers

Can we trigger an shell script on an event

Hi, My program A updates a log called logA. I have a shell script S that is responsible to send emails reading from the log. I want to trigger execution of the script whenever there is an update to the log. Thanks in advance. (8 Replies)
Discussion started by: cv_pan
8 Replies

8. Shell Programming and Scripting

Shell Script to query packages from a http server.

Hello Unix Gurus, Does anybody have an idea on how to verify packages exist on a remote or ftp server connected through http. Here is my task at hand. We have a central repository in which we retrieve our packages. eg. http://packageserver/packages. What i have done is compiled a list of... (2 Replies)
Discussion started by: liketheshell
2 Replies

9. Shell Programming and Scripting

Trigger Shell Script from Current Script

Hello all, I'm new to shell programming and need some help. I would like to set up a step within a shell script to trigger another shell script to run, based on the highest return code generated in the current script. For example, if the highes return code value in the current script is less... (1 Reply)
Discussion started by: mmignot
1 Replies

10. Shell Programming and Scripting

Shell script call from a DB trigger

Has anybody been able to execute a shell script call from a database trigger? If so what are the steps to execute it? Do we have any specific packages in Oracle? Reards, Rahul. (1 Reply)
Discussion started by: rahulrathod
1 Replies
Login or Register to Ask a Question