#!/bin/bash # info: suspend database server # options: TYPE HOST # # example: v-suspend-database-host mysql localhost # # This function for suspending 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_unsuspended "../../conf/$type" 'HOST' "$host" # Perform verification if read-only mode is enabled check_hestia_demo_mode #----------------------------------------------------------# # Action # #----------------------------------------------------------# # Suspend database creation on a server update_object_value "../../conf/$type" 'HOST' "$host" '$SUSPENDED' 'yes' #----------------------------------------------------------# # Hestia # #----------------------------------------------------------# # Logging log_event "$OK" "$ARGUMENTS" exit