mirror of
https://github.com/serghey-rodin/vesta.git
synced 2025-08-20 21:34:11 -07:00
dns cluster support
This commit is contained in:
parent
0f7ea97e12
commit
68a34e18b7
47 changed files with 1536 additions and 64 deletions
54
bin/v-delete-dns-domains-src
Executable file
54
bin/v-delete-dns-domains-src
Executable 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
|
Loading…
Add table
Add a link
Reference in a new issue