2013-01-19 23:07:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
# info: suspend database server
|
|
|
|
# options: TYPE HOST
|
|
|
|
#
|
|
|
|
# The function for suspending a database server.
|
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
|
# Variable&Function #
|
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
2015-11-06 17:38:58 +02:00
|
|
|
# Argument definition
|
2013-01-19 23:07:26 +02:00
|
|
|
type=$1
|
|
|
|
host=$2
|
|
|
|
|
|
|
|
# Includes
|
|
|
|
source $VESTA/func/main.sh
|
2013-10-09 00:50:08 +03:00
|
|
|
source $VESTA/conf/vesta.conf
|
2013-01-19 23:07:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
#----------------------------------------------------------#
|
|
|
|
# Verifications #
|
|
|
|
#----------------------------------------------------------#
|
|
|
|
|
|
|
|
check_args '2' "$#" 'TYPE HOST'
|
2016-06-09 16:31:56 +03:00
|
|
|
is_format_valid 'type' 'host'
|
2013-05-29 13:16:09 +03:00
|
|
|
is_system_enabled "$DB_SYSTEM" 'DB_SYSTEM'
|
2013-01-19 23:07:26 +02:00
|
|
|
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
|
2016-06-09 16:31:56 +03:00
|
|
|
log_event "$OK" "$ARGUMENTS"
|
2013-01-19 23:07:26 +02:00
|
|
|
|
|
|
|
exit
|