redis healthcheck script

This commit is contained in:
Ariel Rin
2023-11-09 18:54:19 +10:00
parent 28fd1b07ea
commit 18fec5f614

View File

@@ -0,0 +1,10 @@
#!/bin/bash
set -eo pipefail
host="$(hostname -i || echo '127.0.0.1')"
if ping="$(redis-cli -h "$host" ping)" && [ "$ping" = 'PONG' ]; then
exit 0
fi
exit 1