Sponsored Content
Top Forums Shell Programming and Scripting Not working Port reachable script Post 302453971 by thakshina on Friday 17th of September 2010 01:41:11 AM
Old 09-17-2010
Not working Port reachable script

Code:
#!/bin/bash

IP=192.168.45.1

telnet $IP 80 >> /dev/null

if [ $? = 0 ]

then

echo "Port is Reachable"

else

echo "Port is not Reachable"

fi

I am tried many times but It's not working at yet..

Kindly help me any one.

Regards,
ThakshinaMoorthy

Last edited by pludi; 09-17-2010 at 08:42 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Port not working

Hi all, I am trying to run a listener through a certain port. The listener starts with no errors but when I do a netstat -n |grep "portNo". It does not show there. I have added the port details into the /etc/services file. If anyone can assist it would be greatly appreciated. Thanks Ryan (6 Replies)
Discussion started by: macgre_r
6 Replies

2. Solaris

How i test the UDP port is working?

Hi anybody know how to test out the UDP port working? cos UDP cannot use telnet to test... Sumemr (2 Replies)
Discussion started by: summerpeh
2 Replies

3. AIX

177 port is up but xmanager is not working in AIX 6.1

Dear Friends, Recently we have to use AIX 6.1 IBM unix server . Here the 177 port is up and also inetd service is up . But we cannot access to the server using X-manager software . server's output : bash-3.00# netstat -nat | grep 177 udp4 0 0 *.177 *.* We have another server AIX-5.3 .... (0 Replies)
Discussion started by: shipon_97
0 Replies

4. Solaris

Sata 2 port not working

I have installed Solaris 11 Express on my machine. On my GA-X58A-UD5 motherboard there are two 6 Gb/s SATA ports (Marvell 9128 chip), but when I connect a hard drive to one of them, the system does not recognize it. However, when I boot from a USB install image (downloaded from here Oracle... (1 Reply)
Discussion started by: RychnD
1 Replies

5. Shell Programming and Scripting

Script not working in cron but working fine manually

Help. My script is working fine when executed manually but the cron seems not to catch up the command when registered. The script is as follow: #!/bin/sh for file in file_1.txt file_2.txt file_3.txt do awk '{ print "0" }' $file > tmp.tmp mv tmp.tmp $file done And the cron... (2 Replies)
Discussion started by: jasperux
2 Replies

6. IP Networking

telnet for port 5433 is not working while it works for port 22

Hi, I am trying to set up a dev environment and I have Ubuntu server (10.16.1.92) and a CentOS VM (10.16.3.235) on this. On the CentOS I have a program running on port 5433. Now my problem is that I am unable to telnet this port from another Windows server whereas I can telnet port 22 from... (5 Replies)
Discussion started by: rishav
5 Replies

7. Solaris

How to find port number wwn of particular port on dual port HBA,?

please find the below o/p for your reference bash-3.00# fcinfo hba-port HBA Port WWN: 21000024ff295a34 OS Device Name: /dev/cfg/c2 Manufacturer: QLogic Corp. Model: 375-3356-02 Firmware Version: 05.03.02 FCode/BIOS Version: BIOS: 2.02; fcode: 2.01;... (3 Replies)
Discussion started by: sb200
3 Replies

8. UNIX for Advanced & Expert Users

Command to check if the server is not reachable using ssh

I have list for servers say server1, server2, server3.....server20 I want to test the ssh connectivity of each server, if any one of the server is down then ssh connectivity fails and the script results something like echo "serever is not reachable" Now I m confused using which command shall I... (2 Replies)
Discussion started by: sam@sam
2 Replies

9. IP Networking

Port Forwarding not working

Hello Gurus, I have configured port forwarding at router. But after configuration I am not able to connect the computer from outside/Over internet/Remote desktp from other computer. Could you please advice? Thanks- Pokhraj (2 Replies)
Discussion started by: pokhraj_d
2 Replies

10. UNIX for Beginners Questions & Answers

Bash script, find the next closed (not in use) port from some port range.

hi, i would like to create a bash script that check which port in my Linux server are closed (not in use) from a specific range, port range (3000-3010). the print output need to be only 1 port, and it will be nice if the output will be saved as a variable or in same file. my code is: ... (2 Replies)
Discussion started by: yossi
2 Replies
escape(1)							Mail Avenger 0.8.3							 escape(1)

NAME
escape - escape shell special characters in a string SYNOPSIS
escape string DESCRIPTION
escape prepends a "" character to all shell special characters in string, making it safe to compose a shell command with the result. EXAMPLES
The following is a contrived example showing how one can unintentionally end up executing the contents of a string: $ var='; echo gotcha!' $ eval echo hi $var hi gotcha! $ Using escape, one can avoid executing the contents of $var: $ eval echo hi `escape "$var"` hi ; echo gotcha! $ A less contrived example is passing arguments to Mail Avenger bodytest commands containing possibly unsafe environment variables. For example, you might write a hypothetical reject_bcc script to reject mail not explicitly addressed to the recipient: #!/bin/sh formail -x to -x cc -x resent-to -x resent-cc | fgrep "$1" > /dev/null && exit 0 echo "<$1>.. address does not accept blind carbon copies" exit 100 To invoke this script, passing it the recipient address as an argument, you would need to put the following in your Mail Avenger rcpt script: bodytest reject_bcc `escape "$RECIPIENT"` SEE ALSO
avenger(1), The Mail Avenger home page: <http://www.mailavenger.org/>. BUGS
escape is designed for the Bourne shell, which is what Mail Avenger scripts use. escape might or might not work with other shells. AUTHOR
David Mazieres Mail Avenger 0.8.3 2012-04-05 escape(1)
All times are GMT -4. The time now is 01:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy