Created
April 25, 2018 22:15
-
-
Save kirkins/4bb19ce0c7f5a8a359520df311bd1c17 to your computer and use it in GitHub Desktop.
A docker file running a simple script to check if a port is open every 15 seconds
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
FROM alpine | |
MAINTAINER [email protected] | |
# Checks if a port is open every 15 seconds | |
# Set the following variables | |
ENV WEBSITE google.com | |
ENV PORT 777 | |
ENV PORT_DOWN_MSG 'Port is down send this message via email/text/ect' | |
# Replace echo with a script to email, text, or discord message | |
CMD watch -n 15 'nc -z -w5 $WEBSITE $PORT \ | |
|| echo $PORT_DOWN_MSG' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment