From 81a0d978fc5cb1c9e28a092537b3aa10b6c91e52 Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Wed, 10 Aug 2016 14:40:23 +0300 Subject: [PATCH] fix for empty aliases --- bin/v-add-web-domain | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/bin/v-add-web-domain b/bin/v-add-web-domain index 04fa9afc..17c64a6f 100755 --- a/bin/v-add-web-domain +++ b/bin/v-add-web-domain @@ -120,12 +120,21 @@ if [ ! -z "$WEB_BACKEND" ]; then check_result $? "Backend error" >/dev/null fi -# Preparing domain variables -if [ "$aliases" != 'none' ]; then - ALIAS="www.$domain,$aliases,$(get_ip_alias $domain)" -else +# Preparing domain aliases +if [ "$aliases" = 'none' ]; then ALIAS='' +else + ALIAS="www.$domain" + if [ ! -z "$aliases" ]; then + ALIAS="$ALIAS,$aliases" + fi + ip_alias=$(get_ip_alias $domain) + if [ ! -z "$ip_alias" ]; then + ALIAS="$ALIAS,$ip_alias" + fi fi + +# Preparing domain variables prepare_web_domain_values # Adding web server config