Created
December 19, 2023 11:49
-
-
Save sdesalas/21230d062a8ab902d66bd453d44a50d7 to your computer and use it in GitHub Desktop.
Check Redis connectivity
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/bash | |
# @see https://stackoverflow.com/questions/33243121/abuse-curl-to-communicate-with-redis | |
# Without any tools | |
exec 3<>/dev/tcp/$REDIS_HOST/6379 && echo -e "PING\r\n" >&3 && head -c 7 <&3 | |
# With netcat (apt install netcat-traditional) | |
(printf "PING\r\n";) | nc $REDIS_HOST 6379 | |
# With telnet | |
telnet $REDIS_HOST 6379 | |
> ping |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment