mirror of
https://github.com/myvesta/vesta
synced 2025-07-11 07:36:47 -07:00
replaced underscore with dash in api syscalls
This commit is contained in:
parent
7ed705cee7
commit
b6b7eacadb
283 changed files with 438 additions and 412 deletions
50
bin/v-delete-database-server
Executable file
50
bin/v-delete-database-server
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