vesta/bin/v-suspend-database-host
2016-06-09 16:55:35 +03:00

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