Script to wait for a specified port to go online or to go offline.
Sample below with invalid parameter.
$ ./xl_wait_port.sh 8080 Usage: xl_wait_port.sh [port] [ up | down ] e.g. xl_wait_port.sh 12004 up Report bugs to: firstname.lastname@example.org
Sample below with correct parameters. Intentionally interrupted with CTRL-C.
$ ./xl_wait_port.sh 8080 down Initiating wait. Waiting for port 8080 to go down. ^C Warning. xl_wait_port.sh has been interupted.
- port - Port number to wait for
- up - If waiting for the port to go online
- down - If waiting for the port to go offline
Enhancements may take some time, I know it is easy but given that the author is just updating the code on a per need basis. All mentioned enhancements are noted below for future reference so that the author may not forget.
- Check lsof prerequisite