forked from outroll/vesta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathv-suspend-database-host
executable file
·47 lines (33 loc) · 1.3 KB
/
v-suspend-database-host
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
# info: suspend database server
# options: TYPE HOST
#
# The function for suspending a database server.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
type=$1
host=$2
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'TYPE HOST'
validate_format '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" "$EVENT"
exit