Files
VestaCP/bin/v_suspend_database_server

48 lines
1.3 KiB
Plaintext
Raw Normal View History

2011-06-14 00:22:25 +03:00
#!/bin/bash
2012-03-27 23:08:44 +03:00
# info: suspend database server
2012-01-03 21:47:10 +02:00
# options: type host
2011-12-26 16:22:43 +02:00
#
2012-03-27 23:08:44 +03:00
# The function for suspending a database server.
2011-12-26 16:22:43 +02:00
2011-06-14 00:22:25 +03:00
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
2011-11-01 12:27:45 +02:00
type=$1
host=$2
2011-06-14 00:22:25 +03:00
2012-03-27 23:08:44 +03:00
# Includes
2012-03-06 22:07:06 +02:00
source $VESTA/conf/vesta.conf
2012-04-30 12:32:11 +03:00
source $VESTA/func/main.sh
2011-06-14 00:22:25 +03:00
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'type host'
2012-03-27 23:08:44 +03:00
validate_format 'type' 'host'
is_system_enabled "$DB_SYSTEM"
is_object_valid "../../conf/$type" 'HOST' "$host"
is_object_unsuspended "../../conf/$type" 'HOST' "$host"
2011-06-14 00:22:25 +03:00
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
2012-03-27 23:08:44 +03:00
# Suspend database creation on a server
update_object_value "../../conf/$type" 'HOST' "$host" '$SUSPENDED' 'yes'
2011-06-14 00:22:25 +03:00
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
2012-03-06 22:07:06 +02:00
log_event "$OK" "$EVENT"
2011-06-14 00:22:25 +03:00
2011-11-01 12:27:45 +02:00
exit