LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-28-2008, 02:00 AM   #1
i.you
Member
 
Registered: Oct 2006
Posts: 46

Rep: Reputation: 15
using wget to download a cgi file


Hi

I wrote a cgi file, HTTPD_ROOT/cgi-bin/lock.cgi, in target PC
in order to run some command on the target PC :

Quote:
#!/bin/sh

sem=`cat /var/lock/semaphore`
sem=$(($sem+1))
echo -n $sem > /var/lock/semaphore

/bin/pidof rsyncmon > /dev/null
if [ $? -eq 0 ]; then
echo "Already running: rsyncmon"
return 0
fi
/usr/local/bin/rsyncmon &

return 0
and I ran wget on my PC :

then I could get the output - /var/lock/semaphore - on target PC
but it failed to download the cgi file, lock.cgi :

Quote:
~# wget http://x.x.x.x/cgi-bin/lock.cgi
--14:31:11-- http://x.x.x.x/cgi-bin/lock.cgi
=> `lock.cgi'
Connecting to x.x.x.x:80... connected.
HTTP request sent, awaiting response...
NO response infinitely...

Any advice to download successfully?
Thanks in advance.
 
Old 03-29-2008, 11:37 AM   #2
theNbomr
LQ 5k Club
 
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,396
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
As part of the server, your CGI must send a proper HTTP response header. A useful HTML reply of some sort would be good as well.
Example (untested):
Code:
    echo "Content-type: text/html"
    echo
    echo "<HTML>"
    echo "<HEAD>"
    echo "<TITLE>LOCK CGI</TITLE>"
    echo "</HEAD>"
    echo "<BODY>"
    echo "Something useful here...."
    echo "</BODY></HTML>"
--- rod.

Last edited by theNbomr; 03-29-2008 at 11:38 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
wget and slackware download ivanatora Slackware 4 01-12-2008 06:12 AM
wget Download Oracle Kryptos Linux - Software 1 01-01-2008 01:08 PM
Script to download file using wget linuxnewbie82 Programming 6 02-14-2007 05:48 AM
wget wont download ?? paul_mat Linux - Software 1 11-01-2005 01:45 AM
what to do with 5 parts of wget download Bruce Hill Linux - Software 2 09-11-2003 11:47 AM


All times are GMT -5. The time now is 12:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration