wget --dns-timeout script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers wget --dns-timeout script
# 1  
Old 12-08-2008
wget --dns-timeout script

Code:
 
#!/bin/sh
# 'clear'
for i in $(seq -w 15 37);
do
echo $i
wget --dns-timeout=0.0001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp -o 1
A=`cat 1`
C=$(expr "$A" : '..............................................................................................................................\(......................\)')
echo The content in C
D="Connection timed out."
echo The content in D
echo $D
if [ "$C" = "$D" ]
then
echo napdweb${i} may be hung,Please restart the server
else
echo napdweb${i} is up and fine
fi
done


Please see the output that i got for the above problem.

OUTPUT:
37
The content in C
Connection timed out.
The content in D
Connection timed out.
napdweb37 is up and fine



As per the code, when the content in C is equal to content in D , it should display that napd server is hung but it is displaying napd is up and fine,can anyone say why the if statement is not working properly.
# 2  
Old 12-08-2008
Try changing

Code:
if [ "$C" = "$D" ]

to

Code:
if [ $C = $D ]

and post back if that works.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding a timeout when using sftp in a script?

Hello guys. I need some help. First of all, sorry about my english, that is not my native languaje. I have a bash script in Solaris with the next lines: And the sftp.sh has this: The problem is that sometimes the sftp takes a long of time. I mean, 2 or 3 hours when it should... (12 Replies)
Discussion started by: giolita25
12 Replies

2. Shell Programming and Scripting

Wget - working in browser but cannot download from wget

Hi, I need to download a zip file from my the below US govt link. https://www.sam.gov/SAMPortal/extractfiledownload?role=WW&version=SAM&filename=SAM_PUBLIC_MONTHLY_20160207.ZIP I only have wget utility installed on the server. When I use the below command, I am getting error 403... (2 Replies)
Discussion started by: Prasannag87
2 Replies

3. Shell Programming and Scripting

Command timeout from inside script.

Hi, I've written a very robust script to get an external IP address from 'behind' a router. It uses many web pages randomly choosing which one/ones to use at run time. The "fetch the web page containing the IP address" is handled by either wget or curl both of which have their 'max time for the... (6 Replies)
Discussion started by: gencon
6 Replies

4. Shell Programming and Scripting

Script to increase Timeout values in Configuration File

Hi Guys I am using one configuration file for reading some time out values.The format of the file is A.Type = Number A.Val = 2000 B.Type = Number B.Val = 4000 Now my requirement is I need to write a shell script in Solaris where i need to increase these timeout values by 10 times of... (3 Replies)
Discussion started by: mr_deb
3 Replies

5. Shell Programming and Scripting

Python script help. Kill binary on timeout

This is part of my script, as you can see when the alarm is raised it shows some text, what I need it to do is to actually kill the binary "test" (TEST_PATH) when the timeout happens. #!/usr/bin/python26 from optparse import OptionParser import nagios import re import subprocess... (0 Replies)
Discussion started by: erick_tuk
0 Replies

6. Shell Programming and Scripting

session timeout for shell script

I am executing test.sh script. But this script takes lot of time and in the meantime the shell timeouts without completing the script. Is there any command which will continue processing the script. Thanks (3 Replies)
Discussion started by: infyanurag
3 Replies

7. Solaris

timeout : unable to connect to DNS

i tried to configure DNS on my x86 PC ,in a network but after following all the below mentioned steps , I am getting the message ."timeout : unable to connect to DNS" Steps followed : Step 1. First check that the necessary packages are installed to configure DNS. Step 2. Configure the... (1 Reply)
Discussion started by: kush singh
1 Replies

8. Shell Programming and Scripting

KSH script SQL timeout issue

Hi all, I have a KSH script which is kicking off an sql scripts as follows: /usr/local/installs/instantclient_10_2/sqlplus -s username/password @$sql_path/sql_query.sql > $tmp_path/sql_query_results The problem I have is that sometimes the 10g Oracle Database spits out an error saying... (4 Replies)
Discussion started by: Donkey25
4 Replies

9. Shell Programming and Scripting

read from std i/p with timeout within a script

hello every one , this is my first participation in the forum , I hope it'll be a good start within a script I would like to put some code to read i\p from standard i\p using read command if it reads Y it will terminate the script if it reads N it will continue execution , if no i\p is... (2 Replies)
Discussion started by: Blue_shadow
2 Replies

10. Shell Programming and Scripting

Can a timeout be specified in a shell script?

Hi, I have to develop a shell script which exits after <n> minutes. For e.g. The user is taking too much time to enter an input, and the script will terminate after 10 minutes pass by. Is this possible ? Thanks, Puneet (3 Replies)
Discussion started by: puneetarora_12
3 Replies
Login or Register to Ask a Question