@@ -14,6 +14,7 @@ format=${1-shell}
1414
1515# Includes
1616source $HESTIA /func/main.sh
17+ source $HESTIA /func/db.sh
1718source $HESTIA /conf/hestia.conf
1819
1920# JSON list function
@@ -23,6 +24,8 @@ json_list() {
2324 objects=0
2425 for type in $( echo $DB_SYSTEM | sed -e ' s/,/\n/' ) ; do
2526 if [ -e " $HESTIA /conf/$type .conf" ]; then
27+ # Set default port values if they don't exist in database configuration file.
28+ database_set_default_ports
2629 db_hosts=$( grep HOST $HESTIA /conf/$type .conf | wc -l)
2730 objects=$(( objects + db_hosts))
2831 fi
@@ -35,6 +38,7 @@ json_list() {
3538 parse_object_kv_list " $str "
3639 echo -n ' {
3740 "HOST": "' $HOST ' ",
41+ "PORT": "' $PORT ' ",
3842 "TYPE": "' $type ' ",
3943 "CHARSETS": "' $CHARSETS ' ",
4044 "MAX_DB": "' $MAX_DB ' ",
@@ -60,13 +64,15 @@ json_list() {
6064# SHELL list function
6165shell_list () {
6266 IFS=$' \n '
63- echo " HOST TYPE MAX_DB DB_USED SPND TIME DATE"
64- echo " ---- ---- ------ ------- ---- ---- ----"
67+ echo " HOST PORT TYPE MAX_DB DB_USED SPND TIME DATE"
68+ echo " ---- ---- ---- ---- -- ------- ---- ---- ----"
6569 for type in $( echo $DB_SYSTEM | sed -e ' s/,/\n/' ) ; do
6670 if [ -e " $HESTIA /conf/$type .conf" ]; then
71+ # Set default port values if they don't exist in database configuration file.
72+ database_set_default_ports
6773 for str in $( cat $HESTIA /conf/$type .conf) ; do
6874 parse_object_kv_list " $str "
69- echo " $HOST $type $MAX_DB $U_DB_BASES $SUSPENDED $TIME $DATE "
75+ echo " $HOST $PORT $ type $MAX_DB $U_DB_BASES $SUSPENDED $TIME $DATE "
7076 done
7177 fi
7278 done
@@ -77,9 +83,11 @@ plain_list() {
7783 IFS=$' \n '
7884 for type in $( echo $DB_SYSTEM | sed -e ' s/,/\n/' ) ; do
7985 if [ -e " $HESTIA /conf/$type .conf" ]; then
86+ # Set default port values if they don't exist in database configuration file.
87+ database_set_default_ports
8088 for str in $( cat $HESTIA /conf/$type .conf) ; do
8189 parse_object_kv_list " $str "
82- echo -ne " $HOST \t$type \t$CHARSETS \t$MAX_DB \t$U_SYS_USERS \t"
90+ echo -ne " $HOST \t$PORT \t $ type \t$CHARSETS \t$MAX_DB \t$U_SYS_USERS \t"
8391 echo -e " $U_DB_BASES \t$TPL \t$SUSPENDED \t$TIME \t$DATE "
8492 done
8593 fi
@@ -89,13 +97,15 @@ plain_list() {
8997# CSV list function
9098csv_list () {
9199 IFS=$' \n '
92- echo -n " HOST,TYPE,CHARSETS,MAX_DB,U_SYS_USERS,"
100+ echo -n " HOST,PORT, TYPE,CHARSETS,MAX_DB,U_SYS_USERS,"
93101 echo " U_DB_BASES,TPL,SUSPENDED,TIME,DATE"
94102 for type in $( echo $DB_SYSTEM | sed -e ' s/,/\n/' ) ; do
95103 if [ -e " $HESTIA /conf/$type .conf" ]; then
104+ # Set default port values if they don't exist in database configuration file.
105+ database_set_default_ports
96106 for str in $( cat $HESTIA /conf/$type .conf) ; do
97107 parse_object_kv_list " $str "
98- echo -n " $HOST ,$type ,\" $CHARSETS \" ,$MAX_DB ,\" $U_SYS_USERS \" ,"
108+ echo -n " $HOST ,$PORT , $ type ,\" $CHARSETS \" ,$MAX_DB ,\" $U_SYS_USERS \" ,"
99109 echo " $U_DB_BASES ,$TPL ,$SUSPENDED ,$TIME ,$DATE "
100110 done
101111 fi
@@ -115,7 +125,6 @@ is_type_format_valid() {
115125# Verifications #
116126# ----------------------------------------------------------#
117127
118-
119128# ----------------------------------------------------------#
120129# Action #
121130# ----------------------------------------------------------#
0 commit comments