Bash public

Redis PING

Share this script safely, inspect its metadata, and copy the exact command you need.

Dashboard

Ready to run

One-liner

Copy the command, then review before execution.
curl -fsSL https://runny.sh/r/TWVWG55D3MHB | bash

Current version: 1.1 · Updated by Godmode · 2026-09-07 02:38:59.319

At a glance

Script metadata

Slug
TWVWG55D3MHB
Fetches
4
Size
798 B · 35 lines
Expires
never
Last fetch
2026-09-07 02:17:51.286
Created
2026-09-07 00:35:59.768
Description
Confirm the Redis server answers PONG

Readable before runnable

Preview

#!/usr/bin/env bash
# Redis ping
# Read-only: redis-cli ping. Does not FLUSH, SET, or write keys.
# Exit 0 on PONG, 1 if redis-cli is missing, 2 if the ping fails.
# Hosted on Runny.sh. Review the script page before you run it.

set -u

note() { printf '%s\n' "$*"; }

note "=== Redis ping ==="
if ! command -v redis-cli >/dev/null 2>&1; then
  note "redis-cli not found in PATH"
  note "Result: WARNING"
  exit 1
fi

note "Client:   $(redis-cli --version 2>/dev/null || printf unknown)"
note "Args:     ${*:-<defaults>}"
note ""
out=$(redis-cli "$@" ping 2>&1) || true
note "Reply:    ${out}"
case "$out" in
  PONG)
    note "          OK"
    note "Result: HEALTHY"
    exit 0
    ;;
  *)
    note "          CRITICAL: ping did not return PONG"
    note "Result: CRITICAL"
    exit 2
    ;;
esac

Raw endpointhttps://runny.sh/r/TWVWG55D3MHB

See something unsafe?

Report this script

Tell us why it should come down. Anyone can also report a URL at /abuse.

Restore revision