Created
June 25, 2015 15:14
-
-
Save shoaibi/e73e84253da488b97356 to your computer and use it in GitHub Desktop.
Test if a remote port is responding or not. Good to be used as part of cron/script that'd send notifications if a port becomes unresponsive
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: $0 {hostname} {port} {pathToScriptToExecuteIfPortIsNotAccessibleSayRestartApacheScript} | |
echo "" | nc $1 $2 && echo $? &>> /dev/null || $3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment