redis.sh 159 B

12345678910
  1. #!/bin/sh
  2. set -eo pipefail
  3. host="$(hostname -i || echo '127.0.0.1')"
  4. if ping="$(redis-cli -h "$host" ping)" && [ "$ping" = 'PONG' ]; then
  5. exit 0
  6. fi
  7. exit 1