From b12677a93f662771f64e62e5cbbebc9adc25a275 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 30 Jun 2014 19:09:26 +0530 Subject: [PATCH] change debug start/stop method --- src/modules/debug/ee_mod_debug_fpm.sh | 4 ++-- src/modules/debug/ee_mod_debug_mysql.sh | 4 ++-- src/modules/debug/ee_mod_debug_nginx.sh | 4 ++-- src/modules/debug/ee_mod_debug_php.sh | 4 ++-- src/modules/debug/ee_mod_debug_rewrite.sh | 4 ++-- src/modules/debug/ee_mod_debug_wp.sh | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/modules/debug/ee_mod_debug_fpm.sh b/src/modules/debug/ee_mod_debug_fpm.sh index 75d41c1a..15786f87 100644 --- a/src/modules/debug/ee_mod_debug_fpm.sh +++ b/src/modules/debug/ee_mod_debug_fpm.sh @@ -2,7 +2,7 @@ function ee_mod_debug_fpm() { - if [ "$1" = "start" ]; then + if [ "$EE_DEBUG" = "--start" ]; then grep "log_level = debug" /etc/php5/fpm/php-fpm.conf &>> $EE_COMMAND_LOG if [ $? -ne 0 ]; then ee_lib_echo "Setup PHP5-FPM log_level = debug, please wait..." @@ -15,7 +15,7 @@ function ee_mod_debug_fpm() # Display message ee_lib_echo "PHP5-FPM log_level = debug already setup" fi - elif [ "$1" = "stop" ]; then + elif [ "$EE_DEBUG" = "--stop" ]; then grep "log_level = debug" /etc/php5/fpm/php-fpm.conf &>> $EE_COMMAND_LOG if [ $? -eq 0 ]; then ee_lib_echo "Disable PHP5-FPM log_level = debug, please wait..." diff --git a/src/modules/debug/ee_mod_debug_mysql.sh b/src/modules/debug/ee_mod_debug_mysql.sh index 15d0a47a..29ff4bec 100644 --- a/src/modules/debug/ee_mod_debug_mysql.sh +++ b/src/modules/debug/ee_mod_debug_mysql.sh @@ -2,7 +2,7 @@ function ee_mod_debug_mysql() { - if [ "$1" = "start" ]; then + if [ "$EE_DEBUG" = "--start" ]; then mysql -e "show variables like 'slow_query_log';" | grep ON &>> $EE_COMMAND_LOG if [ $? -ne 0 ]; then ee_lib_echo "Setup MySQL slow log, please wait..." @@ -22,7 +22,7 @@ function ee_mod_debug_mysql() # Display message ee_lib_echo "MySQL slow log already enabled" fi - elif [ "$1" = "stop" ]; then + elif [ "$EE_DEBUG" = "--stop" ]; then mysql -e "show variables like 'slow_query_log';" | grep ON &>> $EE_COMMAND_LOG if [ $? -eq 0 ]; then ee_lib_echo "Disable MySQL slow log, please wait..." diff --git a/src/modules/debug/ee_mod_debug_nginx.sh b/src/modules/debug/ee_mod_debug_nginx.sh index 6b9af196..62fd326d 100644 --- a/src/modules/debug/ee_mod_debug_nginx.sh +++ b/src/modules/debug/ee_mod_debug_nginx.sh @@ -2,7 +2,7 @@ function ee_mod_debug_nginx() { - if [ "$1" = "start" ]; then + if [ "$EE_DEBUG" = "--start" ]; then if [ -z $EE_DOMAIN ]; then if [ -z "$EE_IP_ADDRESS" ]; then # Enable NGINX debug for all IP @@ -39,7 +39,7 @@ function ee_mod_debug_nginx() ee_lib_echo "Already enable NGINX debug connection for $EE_DOMAIN" fi fi - elif [ "$1" = "stop" ]; then + elif [ "$EE_DEBUG" = "--stop" ]; then if [ -z $EE_DOMAIN ]; then grep "debug_connection" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG if [ $? -eq 0 ]; then diff --git a/src/modules/debug/ee_mod_debug_php.sh b/src/modules/debug/ee_mod_debug_php.sh index 7ee0b13d..90eadfc0 100644 --- a/src/modules/debug/ee_mod_debug_php.sh +++ b/src/modules/debug/ee_mod_debug_php.sh @@ -2,7 +2,7 @@ function ee_mod_debug_php() { - if [ "$1" = "start" ]; then + if [ "$EE_DEBUG" = "--start" ]; then # Perform search inside upstream php block sed -n "/upstream php {/,/}/p" /etc/nginx/conf.d/upstream.conf | grep 9001 &>> $EE_COMMAND_LOG if [ $? -ne 0 ]; then @@ -16,7 +16,7 @@ function ee_mod_debug_php() # Display message ee_lib_echo "PHP5-FPM slow log already enabled" fi - elif [ "$1" = "stop" ]; then + elif [ "$EE_DEBUG" = "--stop" ]; then # Perform search inside upstream php block sed -n "/upstream php {/,/}/p" /etc/nginx/conf.d/upstream.conf | grep 9001 &>> $EE_COMMAND_LOG if [ $? -eq 0 ]; then diff --git a/src/modules/debug/ee_mod_debug_rewrite.sh b/src/modules/debug/ee_mod_debug_rewrite.sh index 06cc3afd..dd04468f 100644 --- a/src/modules/debug/ee_mod_debug_rewrite.sh +++ b/src/modules/debug/ee_mod_debug_rewrite.sh @@ -2,7 +2,7 @@ function ee_mod_debug_rewrite() { - if [ "$1" = "start" ]; then + if [ "$EE_DEBUG" = "--start" ]; then if [ -z $EE_DOMAIN ]; then grep "rewrite_log on;" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG if [ $? -ne 0 ]; then @@ -30,7 +30,7 @@ function ee_mod_debug_rewrite() ee_lib_echo "NGINX rewrite logs for $EE_DOMAIN already enabled" fi fi - elif [ "$1" = "stop" ]; then + elif [ "$EE_DEBUG" = "--stop" ]; then if [ -z $EE_DOMAIN ]; then grep "rewrite_log on;" /etc/nginx/nginx.conf &>> $EE_COMMAND_LOG if [ $? -eq 0 ]; then diff --git a/src/modules/debug/ee_mod_debug_wp.sh b/src/modules/debug/ee_mod_debug_wp.sh index b0cffc7b..a452a22a 100644 --- a/src/modules/debug/ee_mod_debug_wp.sh +++ b/src/modules/debug/ee_mod_debug_wp.sh @@ -2,7 +2,7 @@ function ee_mod_debug_wp() { - if [ "$1" = "start" ]; then + if [ "$EE_DEBUG" = "--start" ]; then if [ -e /var/www/$EE_DOMAIN/wp-config.php ]; then grep "'WP_DEBUG'" /var/www/$EE_DOMAIN/wp-config.php | grep true &>> $EE_COMMAND_LOG if [ $? -ne 0 ]; then @@ -29,7 +29,7 @@ function ee_mod_debug_wp() # Display message ee_lib_echo_fail "Unable to find /var/www/$EE_DOMAIN/wp-config.php" fi - elif [ "$1" = "stop" ]; then + elif [ "$EE_DEBUG" = "--stop" ]; then if [ -e /var/www/$EE_DOMAIN/wp-config.php ]; then grep "'WP_DEBUG'" /var/www/$EE_DOMAIN/wp-config.php | grep true &>> $EE_COMMAND_LOG if [ $? -eq 0 ]; then