You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
hestiacp/bin/v-unsuspend-database-host

53 lines
1.6 KiB

#!/bin/bash
# info: unsuspend database server
# options: TYPE HOST
#
# example: v-unsuspend-database-host mysql localhost
#
# This function for unsuspending a database server.
#----------------------------------------------------------#
# Variables & Functions #
#----------------------------------------------------------#
# Argument definition
type=$1
host=$2
# Includes
# shellcheck source=/etc/hestiacp/hestia.conf
source /etc/hestiacp/hestia.conf
# shellcheck source=/usr/local/hestia/func/main.sh
source $HESTIA/func/main.sh
# load config file
source_conf "$HESTIA/conf/hestia.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_suspended "../../conf/$type" 'HOST' "$host"
# Perform verification if read-only mode is enabled
check_hestia_demo_mode
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Unsuspend database creation on a server
update_object_value "../../conf/$type" 'HOST' "$host" '$SUSPENDED' 'no'
#----------------------------------------------------------#
# Hestia #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$ARGUMENTS"
exit