Skip to content

Commit

Permalink
Create health.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
bloody2k authored Jan 24, 2020
1 parent 88951d2 commit e75b3d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions health.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash

last_msg_delay=${LAST_MSG_DELAY:-30}
now=$(date +%s)
last_time=$(cat last_msg)
echo "Time since last message: $(expr $now - $last_time) seconds"
if [[ $(expr $now - $last_time) -gt $last_msg_delay ]]; then
exit 1
fi

0 comments on commit e75b3d2

Please sign in to comment.