mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-19 21:04:06 -07:00
aligned db scripts with the name convention
This commit is contained in:
parent
a7321e9ab2
commit
370569a82b
6 changed files with 2 additions and 2 deletions
50
bin/v-delete-database-host
Executable file
50
bin/v-delete-database-host
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/bin/bash
|
||||
# info: delete database server
|
||||
# options: TYPE HOST
|
||||
#
|
||||
# The function for deleting the database host from vesta configuration. It will
|
||||
# be deleted if there are no databases created on it only.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
type=$1
|
||||
host=$2
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/db.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '2' "$#" 'TYPE HOST'
|
||||
validate_format 'type' 'host'
|
||||
is_system_enabled "$DB_SYSTEM"
|
||||
is_type_valid "$DB_SYSTEM" "$type"
|
||||
is_object_valid "../../conf/$type" 'HOST' "$host"
|
||||
is_dbhost_free
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
# Deleting server
|
||||
sed -i "/HOST='$host' /d" $VESTA/conf/$type.conf
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "deleted $type database server $host" '' 'admin'
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue