diff --git a/src/modules/site/ee_mod_site_info.sh b/src/modules/site/ee_mod_site_info.sh index 64405f24..fdbff096 100644 --- a/src/modules/site/ee_mod_site_info.sh +++ b/src/modules/site/ee_mod_site_info.sh @@ -14,17 +14,17 @@ function ee_mod_site_info() ee_lib_echo_escape "error_log\t\t \033[37m$ee_error_log" ee_lib_echo_escape "Webroot\t\t\t \033[37m$ee_webroot" - if [ -f /var/www/$EE_DOMAIN/*-config.php ]; then - local ee_db_name=$(grep DB_NAME /var/www/$EE_DOMAIN/*-config.php 2> /dev/null | cut -d"'" -f4) - local ee_db_user=$(grep DB_USER /var/www/$EE_DOMAIN/*-config.php 2> /dev/null | cut -d"'" -f4) - local ee_db_pass=$(grep DB_PASS /var/www/$EE_DOMAIN/*-config.php 2> /dev/null | cut -d"'" -f4) + if [ -f $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/*-config.php/') ]; then + local ee_db_name=$(grep DB_NAME $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/*-config.php/' 2> /dev/null) | cut -d"'" -f4) + local ee_db_user=$(grep DB_USER $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/*-config.php/' 2> /dev/null) | cut -d"'" -f4) + local ee_db_pass=$(grep DB_PASS $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/*-config.php/' 2> /dev/null) | cut -d"'" -f4) ee_lib_echo_escape "DB_NAME\t\t\t \033[37m$ee_db_name" ee_lib_echo_escape "DB_USER\t\t\t \033[37m$ee_db_user" ee_lib_echo_escape "DB_PASS\t\t\t \033[37m$ee_db_pass" - if [ -f /var/www/$EE_DOMAIN/wp-config.php ]; then - local ee_table_prefix=$(grep table_prefix /var/www/$EE_DOMAIN/wp-config.php 2> /dev/null | cut -d"'" -f2) + if [ -f $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/wp-config.php/') ]; then + local ee_table_prefix=$(grep table_prefix $(grep root /etc/nginx/sites-available/$EE_DOMAIN | awk '{ print $2 }' | sed 's/;//g' | sed 's/htdocs/wp-config.php/') | cut -d"'" -f2) ee_lib_echo_escape "table_prefix\t\t \033[37m$ee_table_prefix" fi fi diff --git a/src/modules/site/ee_mod_site_log.sh b/src/modules/site/ee_mod_site_log.sh index ed4afbdc..ea15d81a 100644 --- a/src/modules/site/ee_mod_site_log.sh +++ b/src/modules/site/ee_mod_site_log.sh @@ -2,7 +2,7 @@ function ee_mod_site_log() { - # + # Check if domain name present if [ $# -eq 0 ]; then for site in $(ls /etc/nginx/sites-available/*); do ee_log_path="$ee_log_path /var/log/nginx/$(basename $site).*.log"