mirror of
https://github.com/serghey-rodin/vesta.git
synced 2026-03-11 06:30:35 +01:00
63 lines
1.5 KiB
Bash
Executable File
63 lines
1.5 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: delete database serve
|
|
# 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
|
|
|
|
# Importing variables
|
|
source $VESTA/conf/vars.conf
|
|
source $V_CONF/vesta.conf
|
|
source $V_FUNC/shared.func
|
|
source $V_FUNC/db.func
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
# Checking arg number
|
|
check_args '2' "$#" 'type host'
|
|
|
|
# Checking argument format
|
|
format_validation 'host'
|
|
|
|
# Checking db system is enabled
|
|
is_system_enabled 'db'
|
|
|
|
# Checking db type
|
|
is_type_valid 'db' "$type"
|
|
|
|
# Checking host existance
|
|
is_db_host_valid
|
|
|
|
# Checking db host users
|
|
is_db_host_free
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Deleting host from conf
|
|
del_dbhost_vesta
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event 'system' "$V_EVENT"
|
|
|
|
exit
|