0

I want to complete the following flow: a. Form a shell script from input given by user and send the inputs in form of a shell script back to server. b. Execute the shell script and once shell script execution finishes then send a mail to user.

I am using CGI for completing job a but I have got no clue how to go by for job b but want to use CGI for the same.

Any help will be appreciated.

All this is done in Linux(SUSE)

Thanks!

KronnorK
  • 539
  • 5
  • 17
  • What are you using (Windows or Linux or Mac). What language do you want to write a CGI script in ??, Perl is most common .. Heare is a guide in enabling Apache to run CGI scripts ad a Perl Example. You will need to grab the form Vars from URL like using Get, but i never try it my self -- check --- http://www.techrepublic.com/blog/diy-it-guy/diy-enable-cgi-on-your-apache-server/ – Tasos Apr 22 '14 at 16:16
  • Hi Tasos, Thanks for your comment. This is for SUSE linux. Yes I am doing CGI in perl. I am able complete step a but how to create a job from cgi and execute it is something I am not able to crack. – KronnorK Apr 22 '14 at 16:24
  • What you will need to do is write a CGI script to create another Perl script and execute it within the CGI script. Inside the new script its easy to send a mail when that completes. here is an example on how to run a perl scrip within a perl script. --- http://stackoverflow.com/questions/364842/how-do-i-run-a-perl-script-from-within-a-perl-script – Tasos Apr 22 '14 at 16:41
  • It might be easier to use PHP. – Tasos Apr 22 '14 at 16:45
  • You're letting anonymous users on the Internet execute arbitrary commands on your server? Good luck. – glenn jackman Apr 22 '14 at 17:05
  • Hi All, I have figured out the following: Take the user parameters and pass it to cgi as parameters and then execute them but the issue now is how to send this series of commands to background and then redirect to a page with information saying that the user will get a mail once the process finishes.. – KronnorK Apr 25 '14 at 10:15

0 Answers0