| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- #!/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/vesta.conf
- source $VESTA/func/shared.sh
- source $VESTA/func/db.sh
- #----------------------------------------------------------#
- # Verifications #
- #----------------------------------------------------------#
- # Checking arg number
- check_args '2' "$#" 'type host'
- # Checking argument format
- validate_format 'host'
- # Checking db system is enabled
- is_system_enabled 'DB_SYSTEM'
- # Checking db type
- is_type_valid "$DB_SYSTEM" "$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 "$OK" "$EVENT"
- exit
|