Skip to content

Commit

Permalink
update tools/cminfo.sh 2nd fix mysql service detection
Browse files Browse the repository at this point in the history
and assigning variables when mysql is running

https://community.centminmod.com/posts/28673/
  • Loading branch information
centminmod committed Mar 13, 2016
1 parent 772dccc commit 9e42065
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/cminfo.sh
Expand Up @@ -64,7 +64,7 @@ APC_INFOVER=$(php --ri apc | awk '/Version/ {print $3}' | head -n1)
OPCACHE_INFOVER=$(php -v 2>&1 | grep OPcache | awk '{print $4}' | sed 's/,//')

# only assign variables if mysql is running
if [[ -z "$(service mysql status | grep not)" ]]; then
if [[ "$(ps -o comm -C mysqld >/dev/null 2>&1; echo $?)" = '0' ]]; then
DATABSELIST=$(mysql $MYSQLADMINOPT -e 'show databases;' | grep -Ev '(Database|information_schema|performance_schema)')
MYSQLUPTIME=$(mysqladmin $MYSQLADMINOPT ext | awk '/Uptime|Uptime_since_flush_status/ { print $4 }' | head -n1)
MYSQLUPTIMEFORMAT=$(mysqladmin $MYSQLADMINOPT ver | awk '/Uptime/ { print $2, $3, $4, $5, $6, $7, $8, $9 }')
Expand Down

0 comments on commit 9e42065

Please sign in to comment.