mirror of
https://github.com/myvesta/vesta
synced 2025-07-16 10:03:23 -07:00
include new db type in vesta config
This commit is contained in:
parent
567ce7e832
commit
83b7110c0a
1 changed files with 18 additions and 5 deletions
|
@ -65,8 +65,8 @@ is_pgsql_host_alive() {
|
|||
args_usage='TYPE HOST DBUSER DBPASS [MAX_DB] [CHARSETS] [TPL]'
|
||||
check_args '4' "$#" "$args_usage"
|
||||
validate_format 'host' 'dbuser' 'max_db' 'charsets' 'template'
|
||||
is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
|
||||
is_type_valid "$DB_SYSTEM" "$type"
|
||||
#is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
|
||||
#is_type_valid "$DB_SYSTEM" "$type"
|
||||
is_dbhost_new
|
||||
is_password_valid
|
||||
dbpass="$password"
|
||||
|
@ -91,15 +91,28 @@ case $type in
|
|||
str="$str TIME='$TIME' DATE='$DATE'";;
|
||||
esac
|
||||
|
||||
# Adding host to conf
|
||||
echo "$str" >> $VESTA/conf/$type.conf
|
||||
chmod 660 $VESTA/conf/$type.conf
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Adding host to conf
|
||||
echo "$str" >> $VESTA/conf/$type.conf
|
||||
chmod 660 $VESTA/conf/$type.conf
|
||||
|
||||
# Updating vesta.conf
|
||||
if [ -z "$(grep DB_SYSTEM $VESTA/conf/vesta.conf)" ]; then
|
||||
echo "DB_SYSTEM='$type'" >> $VESTA/conf/vesta.conf
|
||||
else
|
||||
db=$(echo "$DB_SYSTEM,$type" |\
|
||||
sed "s/,/\n/g"|\
|
||||
sort -r -u |\
|
||||
sed "/^$/d"|\
|
||||
sed ':a;N;$!ba;s/\n/,/g')
|
||||
sed -i "s/DB_SYSTEM=.*/DB_SYSTEM='$db'/g" $VESTA/conf/vesta.conf
|
||||
fi
|
||||
|
||||
# Logging
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue