Skip to content

Commit 6af2fc6

Browse files
author
Kristan Kenney
committed
Fix HostAliases error when no aliases defined for domain in awstats
Fixes hestiacp#730
1 parent 7a22d8e commit 6af2fc6

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

bin/v-add-web-domain-stats

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ get_domain_values 'web'
5555

5656
# Adding statistic config
5757
prepare_web_domain_values
58+
59+
if [ -z "${aliases//,/ }" ]; then
60+
stats_alias="localhost"
61+
else
62+
stats_alias=${aliases_idn//,/ }
63+
fi
64+
5865
cat $WEBTPL/$type/$type.tpl |\
5966
sed -e "s|%ip%|$ip|g" \
6067
-e "s|%web_port%|$WEB_PORT|g" \
@@ -69,7 +76,7 @@ cat $WEBTPL/$type/$type.tpl |\
6976
-e "s|%user%|$user|g" \
7077
-e "s|%home%|$HOMEDIR|g" \
7178
-e "s|%alias%|${aliases//,/ }|g" \
72-
-e "s|%alias_idn%|${aliases_idn//,/ }|g" \
79+
-e "s|%alias_idn%|$stats_alias|g" \
7380
> $HOMEDIR/$user/conf/web/$domain/$type.conf
7481

7582
if [ "$type" == 'awstats' ]; then

0 commit comments

Comments
 (0)