Skip to content

Commit f357610

Browse files
committed
suspend/unsuspend remote dns hosts
1 parent 0ae212e commit f357610

File tree

2 files changed

+92
-0
lines changed

2 files changed

+92
-0
lines changed

bin/v-suspend-remote-dns-host

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# info: suspend remote dns server
3+
# options: HOST
4+
#
5+
# The function for suspending remote dns server.
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument defenition
13+
host=$1
14+
15+
# Includes
16+
source $VESTA/func/main.sh
17+
source $VESTA/conf/vesta.conf
18+
19+
20+
#----------------------------------------------------------#
21+
# Verifications #
22+
#----------------------------------------------------------#
23+
24+
check_args '1' "$#" 'HOST'
25+
validate_format 'host'
26+
is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
27+
is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
28+
is_object_unsuspended "../../conf/dns-cluster" 'HOST' "$host"
29+
30+
31+
#----------------------------------------------------------#
32+
# Action #
33+
#----------------------------------------------------------#
34+
35+
# Unsuspend remote dns server
36+
update_object_value "../../conf/dns-cluster" 'HOST' "$host" '$SUSPENDED' 'yes'
37+
38+
39+
#----------------------------------------------------------#
40+
# Vesta #
41+
#----------------------------------------------------------#
42+
43+
# Logging
44+
log_event "$OK" "$EVENT"
45+
46+
exit

bin/v-unsuspend-remote-dns-host

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
#!/bin/bash
2+
# info: unsuspend remote dns server
3+
# options: HOST
4+
#
5+
# The function for unsuspending remote dns server.
6+
7+
8+
#----------------------------------------------------------#
9+
# Variable&Function #
10+
#----------------------------------------------------------#
11+
12+
# Argument defenition
13+
host=$1
14+
15+
# Includes
16+
source $VESTA/func/main.sh
17+
source $VESTA/conf/vesta.conf
18+
19+
20+
#----------------------------------------------------------#
21+
# Verifications #
22+
#----------------------------------------------------------#
23+
24+
check_args '1' "$#" 'HOST'
25+
validate_format 'host'
26+
is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
27+
is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
28+
is_object_suspended "../../conf/dns-cluster" 'HOST' "$host"
29+
30+
31+
#----------------------------------------------------------#
32+
# Action #
33+
#----------------------------------------------------------#
34+
35+
# Unsuspend remote dns server
36+
update_object_value "../../conf/dns-cluster" 'HOST' "$host" '$SUSPENDED' 'no'
37+
38+
39+
#----------------------------------------------------------#
40+
# Vesta #
41+
#----------------------------------------------------------#
42+
43+
# Logging
44+
log_event "$OK" "$EVENT"
45+
46+
exit

0 commit comments

Comments
 (0)