Script to check if Port is Active


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script to check if Port is Active
# 1  
Old 08-10-2010
Script to check if Port is Active

is there a better way to check if a port is active on linux and sunos systems?

this is currently what I'm using in my script:

Code:
netstat -an | egrep -i "$PORT"


i know this isn't the best way as there could be numbers in that output that has my port number in it but isn't necessarily a port.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

How to check the IP:PORT firewall uses?

I have my firewall process running # ps -ef | grep firewall root 21169 1 0 08:50 ? 00:00:00 /usr/bin/python -Es /usr/sbin/firewalld --nofork --nopid I wish to know what ip : port number it is using. Can you please tell me how can i find out ? I tried the below command... (4 Replies)
Discussion started by: mohtashims
4 Replies

3. Shell Programming and Scripting

Check active DHCP leases

Hi all, I'm far from an expert so bear with me on this. I'm writing a script to check for check for active DHCP leases on each subnet configured on a server, and clear and restart DHCP if the usage is above 90%. The possible scope is /16 - /24. /usr/share/flint/scripts/leasecheck.pl is a perl... (2 Replies)
Discussion started by: iamtheliquor
2 Replies

4. Red Hat

How to check port used for SSL?

I have RHEL 5.8 in our production environment. We are using SSL, my query is how to find the port used for SSL. In /etc/services, it shows 443 but when I give netstat -tulpn | grep 443 Or netstat -tulp | grep https I do not get any output. I hope, my question is clear of how to find... (4 Replies)
Discussion started by: RHCE
4 Replies

5. Shell Programming and Scripting

*ix script to check port of client server and return output

Hello EveryOne, I am new to *ix. some could help to write a script. Problem :- Have to ssh to so many client and check port or filesystem usage, so thinking to automate using script. What i Need:- when i run script on my Launchpad server, it should Should ask and SSH to user provided... (3 Replies)
Discussion started by: MeFirst
3 Replies

6. Shell Programming and Scripting

Linux Script to check Active URL in Firefox

Hey guys, currently I'm struggling with a little script to check an active URL in my running Firefox. What I'm doing: I'm running a low VPS with about 768mb RAM and Ubuntu on it. I only installed Fluxbox + Firefox to it in order to keep the resource consumption as low as possible. I think i... (8 Replies)
Discussion started by: uniflow
8 Replies

7. Solaris

Port Active?

Hi, I have recently installed autosys R11 on my a container in solaris 10. the container has solaris 10. I am now trying to configure the autosys workload contol center on a windows VM. but i can not get the contol center to log into the the autosys server. when i try to estiblish a... (4 Replies)
Discussion started by: dshakey
4 Replies

8. Shell Programming and Scripting

Monitor Port, if active, pipe command to screen

I am a linux newbie and I am learning. I need a script that will monitor a port and if active -- only active, not listening or waiting -- then pipe some commands to the screen as if they were typed on the keyboard. Can a bash or perl script do this and if so, could someone help me out? Thanks. (0 Replies)
Discussion started by: bulgin
0 Replies

9. UNIX for Dummies Questions & Answers

How do you check whether a port currently being used?

Hi, Please help me out, how to check whether a port currently being used or not. is there any command which give the result? Thanks Rajesh (6 Replies)
Discussion started by: rajesh08
6 Replies

10. Programming

POSIX - Hot to check if detached thread is still active

Hello, I have created program that run threads one by one, maximum 100. Each thread will process one block of data, and once it`s finished, new thread is created with new block of data....etc I have array of values to control status of each thread, like this: array_thread_status=1... (11 Replies)
Discussion started by: orangem
11 Replies
Login or Register to Ask a Question
INSTALLSIEVE(1) 					      General Commands Manual						   INSTALLSIEVE(1)

 *

NAME
installsieve - user utility for managing sieve scripts SYNOPSIS
installsieve DESCRIPTION
installsieve is a utility that allows users to manage their sieve scripts kept on the server. OPTIONS
-v <name> View script with the given name. The script if retrieved sucessfully is output to standard output. -l List all of the scripts currently on the server. If one of the scripts is active a arrow is printed indicating that it is the active script. -p <port> Port to connect to. If left off this defaults to "sieve" as defined in /etc/services. -i <file> Install a file onto the server. If a script with the same name already exists on the server it is overwritten. Upon sucessfully putting the script on the server the script is set active. If <file> has the extension .script it is chopped when put on the server since sieve names may not contain a '.'. -a <name> Set <name> as the active script. The list of available names can be obtained from the '-l' option.. -d <name> Delete the sieve script on the server with <name>. -m <mechanism> Force installsieve to use <mechanism> for authentication. If not specified the strongest authentication mechanism is chosen. -g <name> Get the sieve script with <name> and save it to disk with a ".script" extension. If a file with that name already exists it is overwritten. -u <user> Userid/Authname to use for authentication; by default, the current user. CMU
Project Cyrus INSTALLSIEVE(1)