Created
March 4, 2019 13:53
-
-
Save Eeemil/7695024a19c909881d83765113574672 to your computer and use it in GitHub Desktop.
Script to use in probes in Kubernetes to determine that a health file is modified within the last minute
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 | |
# Returns 0 if health file has been modified within the last minute | |
# Otherwise return non-zero | |
# Usage: ./probe.sh [health-file] | |
HEALTH_FILE=${1:-"/opt/app/alive.txt"} | |
test $(find ${HEALTH_FILE} -mmin -1) | |
exit $? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment