mirror of
https://github.com/YunoHost-Apps/linuxdash_ynh.git
synced 2024-09-03 19:36:07 +02:00
18 lines
533 B
Bash
18 lines
533 B
Bash
|
#!/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%?} }
|