File tree Expand file tree Collapse file tree 1 file changed +18
-5
lines changed
Expand file tree Collapse file tree 1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -65,8 +65,8 @@ is_pgsql_host_alive() {
6565args_usage=' TYPE HOST DBUSER DBPASS [MAX_DB] [CHARSETS] [TPL]'
6666check_args ' 4' " $# " " $args_usage "
6767validate_format ' host' ' dbuser' ' max_db' ' charsets' ' template'
68- is_system_enabled " $DB_SYSTEM " ' DB_SYSTEM'
69- is_type_valid " $DB_SYSTEM " " $type "
68+ # is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
69+ # is_type_valid "$DB_SYSTEM" "$type"
7070is_dbhost_new
7171is_password_valid
7272dbpass=" $password "
@@ -91,15 +91,28 @@ case $type in
9191 str=" $str TIME='$TIME ' DATE='$DATE '" ;;
9292esac
9393
94- # Adding host to conf
95- echo " $str " >> $VESTA /conf/$type .conf
96- chmod 660 $VESTA /conf/$type .conf
9794
9895
9996# ----------------------------------------------------------#
10097# Vesta #
10198# ----------------------------------------------------------#
10299
100+ # Adding host to conf
101+ echo " $str " >> $VESTA /conf/$type .conf
102+ chmod 660 $VESTA /conf/$type .conf
103+
104+ # Updating vesta.conf
105+ if [ -z " $( grep DB_SYSTEM $VESTA /conf/vesta.conf) " ]; then
106+ echo " DB_SYSTEM='$type '" >> $VESTA /conf/vesta.conf
107+ else
108+ db=$( echo " $DB_SYSTEM ,$type " | \
109+ sed " s/,/\n/g" | \
110+ sort -r -u | \
111+ sed " /^$/d" | \
112+ sed ' :a;N;$!ba;s/\n/,/g' )
113+ sed -i " s/DB_SYSTEM=.*/DB_SYSTEM='$db '/g" $VESTA /conf/vesta.conf
114+ fi
115+
103116# Logging
104117log_event " $OK " " $EVENT "
105118
You can’t perform that action at this time.
0 commit comments