1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/linuxdash_ynh.git synced 2024-09-03 19:36:07 +02:00
linuxdash_ynh/sources/server/modules/shell_files/redis.sh

18 lines
533 B
Bash
Raw Normal View History

#!/bin/bash
########### Enter Your Redis Password HERE #########
redisPassword=''
########### Enter Your Redis Password HERE #########
redisCommand=$(which redis-cli);
if [ -n "$redisPassword" ]; then
redisCommand="$redisCommand -a $redisPassword"
fi
result=$($redisCommand INFO \
| grep 'redis_version\|connected_clients\|connected_slaves\|used_memory_human\|total_connections_received\|total_commands_processed' \
| awk -F: '{print "\"" $1 "\":" "\"" $2 }' \
| tr '\r' '"' | tr '\n' ','
)
echo { ${result%?} }