Skip to content

Commit ebdbe96

Browse files
committed
idn support for awstats
1 parent fb216fc commit ebdbe96

5 files changed

+14
-5
lines changed

bin/v-add-web-domain-stats

+2-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,8 @@ cat $WEBTPL/$type.tpl |\
6666
> $HOMEDIR/$user/conf/web/$type.$domain.conf
6767

6868
if [ "$type" == 'awstats' ]; then
69-
ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf /etc/awstats/
69+
ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \
70+
/etc/awstats/$type.$domain_idn.conf
7071
fi
7172

7273

bin/v-change-web-domain-stats

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ cat $WEBTPL/$type.tpl |\
7777
-e "s/%alias_idn%/${aliases_idn//,/ }/g" \
7878
> $HOMEDIR/$user/conf/web/$type.$domain.conf
7979

80+
if [ "$type" == 'awstats' ]; then
81+
ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \
82+
/etc/awstats/$type.$domain_idn.conf
83+
fi
84+
8085

8186
#----------------------------------------------------------#
8287
# Vesta #

bin/v-delete-web-domain-stats

+2-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# Argument defenition
1414
user=$1
1515
domain=$(idn -t --quiet -u "$2" )
16+
domain_idn=$(idn -t --quiet -a "$domain")
1617

1718
# Includes
1819
source $VESTA/conf/vesta.conf
@@ -48,7 +49,7 @@ stats_dir="$HOMEDIR/$user/web/$domain/stats"
4849
rm -rf $stats_dir/*
4950

5051
# Deleting config
51-
rm -f /etc/awstats/$STATS.$domain.conf
52+
rm -f /etc/awstats/$STATS.$domain_idn.conf
5253
rm -f $HOMEDIR/$user/conf/web/$STATS.$domain.conf
5354

5455

bin/v-rebuild-web-domains

+4-2
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,11 @@ for domain in $(shell_list) ; do
136136
-e "s/%alias_idn%/${aliases_idn//,/ }/g" \
137137
> $HOMEDIR/$user/conf/web/$STATS.$domain.conf
138138

139+
139140
if [ "$STATS" == 'awstats' ]; then
140-
if [ ! -e "/etc/awstats/$STATS.$domain.conf" ]; then
141-
ln -s $HOMEDIR/$user/conf/web/$STATS.$domain.conf /etc/awstats/
141+
if [ ! -e "/etc/awstats/$STATS.$domain_idn.conf" ]; then
142+
ln -s $HOMEDIR/$user/conf/web/$STATS.$domain.conf \
143+
/etc/awstats/$STATS.$domain_idn.conf
142144
fi
143145
fi
144146

bin/v-update-web-domain-stat

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ build_webalizer() {
6262
build_awstats() {
6363
awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"
6464
wwwroot="/usr/share/awstats/wwwroot"
65-
opts="-config=$domain -staticlinks -update -output"
65+
opts="-config=$domain_idn -staticlinks -update -output"
6666
month=$(date "+%Y-%m")
6767
output='alldomains allhosts lasthosts unknownip allrobots lastrobots
6868
urldetail urlentry urlexit osdetail browserdetail unknownbrowser

0 commit comments

Comments
 (0)