feat(node): adding all in one node support
This commit is contained in:
27
resources/node/files/scripts/ping-sentinel.sh
Normal file
27
resources/node/files/scripts/ping-sentinel.sh
Normal file
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
ping_sentinel() {
|
||||
resp=$(timeout -s 15 $1 \
|
||||
valkey-cli \
|
||||
-h localhost \
|
||||
-p $VALKEY_SENTINEL_PORT \
|
||||
ping)
|
||||
ret=${?}
|
||||
echo $resp
|
||||
return ${ret}
|
||||
}
|
||||
|
||||
response=$(ping_sentinel 5)
|
||||
if [ "${?}" -eq 124 ]; then
|
||||
echo "Sentinel ping timed out"
|
||||
exit 124
|
||||
fi
|
||||
|
||||
if [ "${response}" != "PONG" ];
|
||||
then
|
||||
echo "Sentinel is not responding"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "$( date +'[%Y/%m/%d %H:%M:%S]') Sentinel is responding"
|
||||
exit 0
|
Reference in New Issue
Block a user