summaryrefslogtreecommitdiffstats
path: root/mockrun
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-04-26 09:24:37 +0200
committerRemi Collet <remi@php.net>2024-04-26 09:24:37 +0200
commiteb7e370cb03a68bfb9cc229088dc5b8c78a47040 (patch)
treeb020a1b138c248abc0220428b0996b047f0170f2 /mockrun
parentfe4a06d6bd6cea9899295c550076894b19c3f09b (diff)
fix redis server address
Diffstat (limited to 'mockrun')
-rwxr-xr-xmockrun16
1 files changed, 8 insertions, 8 deletions
diff --git a/mockrun b/mockrun
index 1d3e51a..4554626 100755
--- a/mockrun
+++ b/mockrun
@@ -1,17 +1,17 @@
#!/bin/bash
-CHECK=$(redis-cli ping)
-[ "$CHECK" = "PONG" ] || exit 1
-
# ARCH detection and check
if [ "$(uname -m)" = "x86_64" ]; then
- SUF=x
QUEUE=mockx
+ REDISCLI="redis-cli"
else
- SUF=a
QUEUE=mocka
+ REDISCLI="redis-cli -h remi"
fi
+CHECK=$($REDISCLI ping)
+[ "$CHECK" = "PONG" ] || exit 1
+
if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage $0 [ option ]"
echo " -e --erase to empty the queue"
@@ -21,17 +21,17 @@ if [ "$1" = "-h" -o "$1" = "--help" ]; then
exit 0
elif [ "$1" = "-l" -o "$1" = "--list" ]; then
- redis-cli smembers $QUEUE
+ $REDISCLI smembers $QUEUE
exit 0
elif [ "$1" = "-e" -o "$1" = "--erase" ]; then
- redis-cli del $QUEUE
+ $REDISCLI del $QUEUE
exit 0
fi
while true
do
- CMD=$(redis-cli spop $QUEUE)
+ CMD=$($REDISCLI spop $QUEUE)
if [ -z "$CMD" ]; then
if [ "$1" = "-p" -o "$1" = "--perm" ]; then
echo -n .