Skip to content

Commit

Permalink
More updates for redis status.
Browse files Browse the repository at this point in the history
  • Loading branch information
wayneeseguin committed Mar 24, 2011
1 parent 98c4ec5 commit a301fbb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions redis/bin/status
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@


source "${extension_scripts_path}/initialize" source "${extension_scripts_path}/initialize"


log "redis-server:"

if [[ -s "${redis_pid_file}" ]] ; then if [[ -s "${redis_pid_file}" ]] ; then
server_version=$("${init_scripts_path}/redis" info | awk -F: '/redis_version/{print $2}') log " status: running"
port=$(awk '/^port/{print $2}' /etc/redis/redis.conf) log " pid: $(cat ${redis_pid_file})"
log "Redis server version ${server_version} is running on port ${port:-6379}"
else else
log "Redis server is not running on port ${port:-6379}" log " status: not running"
fi fi


log " version: $("${init_scripts_path}/redis" info | head -1 | awk -F: '/redis_version/{print $2}')"
log " port: $(awk '/^port/{print $2}' ${redis_config_file} || printf "6379")"
log " pidfile: $(awk '/^pidfile/{print $2}' ${redis_config_file})"
log " logfile: $(awk '/^logfile/{print $2}' ${redis_config_file})"
log " dbfile: $(awk '/^dbfilename/{print $2}' ${redis_config_file})"

exit 0

0 comments on commit a301fbb

Please sign in to comment.