Code refactoring: domain_idn + new restart routine

This commit is contained in:
Serghey Rodin 2017-01-11 16:52:11 +02:00
commit e5950d516d
104 changed files with 605 additions and 588 deletions

View file

@ -26,11 +26,6 @@ if [ -z "$priority" ]; then
priority=10
fi
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
@ -55,6 +50,10 @@ if [[ "$dvalue" =~ [\;[:space:]] ]]; then
dvalue='"'"$dvalue"'"'
fi
# Additional argument formatting
format_domain
format_domain_idn
#----------------------------------------------------------#
# Verifications #
@ -121,10 +120,8 @@ update_object_value 'dns' 'DOMAIN' "$domain" '$RECORDS' "$records"
increase_user_value "$user" '$U_DNS_RECORDS'
# Restart named
if [ "$restart" != 'no' ]; then
$BIN/v-restart-dns
check_result $? $E_RESTART 'dns failed to restart'
fi
$BIN/v-restart-dns $restart
check_result $? $E_RESTART 'dns failed to restart'
# Logging
log_history "added $rtype dns record $record for $domain"