mirror of
https://github.com/myvesta/vesta
synced 2025-08-21 13:54:28 -07:00
Code refactoring: domain_idn + new restart routine
This commit is contained in:
parent
b98abaf572
commit
e5950d516d
104 changed files with 605 additions and 588 deletions
|
@ -13,20 +13,19 @@
|
|||
|
||||
# Argument definition
|
||||
user=$1
|
||||
domain=$(idn -t --quiet -u "$2" )
|
||||
domain=$2
|
||||
template=$3
|
||||
restart=$4
|
||||
|
||||
domain_idn="$domain"
|
||||
if [[ "$domain" = *[![:ascii:]]* ]]; then
|
||||
domain_idn=$(idn -t --quiet -a $domain)
|
||||
fi
|
||||
|
||||
# Includes
|
||||
source $VESTA/func/main.sh
|
||||
source $VESTA/func/domain.sh
|
||||
source $VESTA/conf/vesta.conf
|
||||
|
||||
# Additional argument formatting
|
||||
format_domain
|
||||
format_domain_idn
|
||||
|
||||
|
||||
#----------------------------------------------------------#
|
||||
# Verifications #
|
||||
|
@ -121,10 +120,8 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$TPL' "$template"
|
|||
update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records"
|
||||
|
||||
# Restarting named
|
||||
if [ "$restart" != 'no' ]; then
|
||||
$BIN/v-restart-dns
|
||||
check_result $? "DNS restart failed" >/dev/null
|
||||
fi
|
||||
$BIN/v-restart-dns $restart
|
||||
check_result $? "DNS restart failed" >/dev/null
|
||||
|
||||
# Logging
|
||||
log_history "changed dns template for $domain to $template" '' 'admin'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue