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

@ -11,22 +11,21 @@
# Argument definition
user=$1
domain=$(idn -t --quiet -u "$2" )
domain=$2
id=$3
dvalue=$(idn -t --quiet -u "$4" )
priority=$5
restart=$6
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 #
@ -105,10 +104,8 @@ fi
#----------------------------------------------------------#
# 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 record on $domain to $dvalue"