dns cluster support

This commit is contained in:
Serghey Rodin 2013-05-28 16:09:07 +03:00
commit 68a34e18b7
47 changed files with 1536 additions and 64 deletions

54
bin/v-delete-dns-domains-src Executable file
View file

@ -0,0 +1,54 @@
#!/bin/bash
# info: delete dns domains based on SRC field
# options: USER SRC [RESTART]
#
# The function for deleting DNS domains related to a certain host.
#----------------------------------------------------------#
# Variable&Function #
#----------------------------------------------------------#
# Argument defenition
user=$1
src=$2
restart=$3
# Includes
source $VESTA/conf/vesta.conf
source $VESTA/func/main.sh
#----------------------------------------------------------#
# Verifications #
#----------------------------------------------------------#
check_args '2' "$#" 'USER SRC [RESTART]'
validate_format 'user' 'src'
is_system_enabled "$DNS_SYSTEM"
is_object_valid 'user' 'USER' "$user"
#----------------------------------------------------------#
# Action #
#----------------------------------------------------------#
# Starting delete loop
for domain in $(search_objects 'dns' 'SRC' "$src" 'DOMAIN'); do
$BIN/v-delete-dns-domain "$user" "$domain" 'no'
done
#----------------------------------------------------------#
# Vesta #
#----------------------------------------------------------#
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns "$EVENT"
fi
# Logging
log_event "$OK" "$EVENT"
exit