suspend/unsuspend remote dns hosts

This commit is contained in:
Serghey Rodin 2013-10-21 16:21:43 +03:00
parent 0ae212e554
commit f357610bc7
2 changed files with 92 additions and 0 deletions

46
bin/v-suspend-remote-dns-host Executable file
View file

@ -0,0 +1,46 @@
#!/bin/bash
# info: suspend remote dns server
# options: HOST
#
# The function for suspending remote dns server.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
host=$1
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'HOST'
validate_format 'host'
is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
is_object_unsuspended "../../conf/dns-cluster" 'HOST' "$host"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Unsuspend remote dns server
update_object_value "../../conf/dns-cluster" 'HOST' "$host" '$SUSPENDED' 'yes'
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit

46
bin/v-unsuspend-remote-dns-host Executable file
View file

@ -0,0 +1,46 @@
#!/bin/bash
# info: unsuspend remote dns server
# options: HOST
#
# The function for unsuspending remote dns server.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
host=$1
# Includes
source $VESTA/func/main.sh
source $VESTA/conf/vesta.conf
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '1' "$#" 'HOST'
validate_format 'host'
is_system_enabled "$DNS_SYSTEM" 'DNS_SYSTEM'
is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
is_object_suspended "../../conf/dns-cluster" 'HOST' "$host"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Unsuspend remote dns server
update_object_value "../../conf/dns-cluster" 'HOST' "$host" '$SUSPENDED' 'no'
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Logging
log_event "$OK" "$EVENT"
exit