mirror of
https://github.com/myvesta/vesta.git
synced 2024-11-20 20:40:08 -08:00
48 lines
1.3 KiB
Bash
Executable File
48 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# info: suspend database server
|
|
# options: TYPE HOST
|
|
#
|
|
# The function for suspending a database server.
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Variable&Function #
|
|
#----------------------------------------------------------#
|
|
|
|
# Argument definition
|
|
type=$1
|
|
host=$2
|
|
|
|
# Includes
|
|
source $VESTA/func/main.sh
|
|
source $VESTA/conf/vesta.conf
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Verifications #
|
|
#----------------------------------------------------------#
|
|
|
|
check_args '2' "$#" 'TYPE HOST'
|
|
is_format_valid 'type' 'host'
|
|
is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
|
|
is_object_valid "../../conf/$type" 'HOST' "$host"
|
|
is_object_unsuspended "../../conf/$type" 'HOST' "$host"
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Action #
|
|
#----------------------------------------------------------#
|
|
|
|
# Suspend database creation on a server
|
|
update_object_value "../../conf/$type" 'HOST' "$host" '$SUSPENDED' 'yes'
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
# Vesta #
|
|
#----------------------------------------------------------#
|
|
|
|
# Logging
|
|
log_event "$OK" "$ARGUMENTS"
|
|
|
|
exit
|