mirror of
https://github.com/myvesta/vesta
synced 2025-08-14 10:37:42 -07:00
remote dns host management
This commit is contained in:
parent
370569a82b
commit
bab24899ea
6 changed files with 299 additions and 2 deletions
56
bin/v-delete-remote-dns-host
Executable file
56
bin/v-delete-remote-dns-host
Executable file
|
@ -0,0 +1,56 @@
|
|||
#!/bin/bash
|
||||
# info: delete remote dns host
|
||||
# options: HOST
|
||||
#
|
||||
# The function for deleting the remote dns host from vesta configuration.
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Variable&Function #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Argument defenition
|
||||
host=$1
|
||||
|
||||
# Includes
|
||||
source $VESTA/conf/vesta.conf
|
||||
source $VESTA/func/main.sh
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
check_args '1' "$#" 'HOST'
|
||||
validate_format 'host'
|
||||
is_system_enabled "$DNS_CLUSTER" 'DNS_CLUSTER'
|
||||
is_object_valid "../../conf/dns-cluster" 'HOST' "$host"
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Action #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Deleting domains
|
||||
$BIN/v-delete-remote-dns-domains $host >>/dev/null 2>&1
|
||||
|
||||
# Deleting server
|
||||
sed -i "/HOST='$host' /d" $VESTA/conf/dns-cluster.conf
|
||||
|
||||
# Disabling DNS_CLUSTER
|
||||
check_cluster=$(grep HOST $VESTA/conf/dns-cluster.conf |wc -l)
|
||||
if [ "$check_cluster" -eq '0' ]; then
|
||||
rm -f $VESTA/conf/dns-cluster.conf
|
||||
sed -i "/DNS_CLUSTER=/d" $VESTA/conf/vesta.conf
|
||||
fi
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Vesta #
|
||||
#----------------------------------------------------------#
|
||||
|
||||
# Logging
|
||||
log_history "deleted $type database server $host" '' 'admin'
|
||||
log_event "$OK" "$EVENT"
|
||||
|
||||
exit
|
Loading…
Add table
Add a link
Reference in a new issue