From ebdbe965e81627f7e0bcec2bbc7cab64c4fc4bdb Mon Sep 17 00:00:00 2001 From: Serghey Rodin Date: Mon, 21 Jan 2013 21:25:54 +0200 Subject: [PATCH] idn support for awstats --- bin/v-add-web-domain-stats | 3 ++- bin/v-change-web-domain-stats | 5 +++++ bin/v-delete-web-domain-stats | 3 ++- bin/v-rebuild-web-domains | 6 ++++-- bin/v-update-web-domain-stat | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/bin/v-add-web-domain-stats b/bin/v-add-web-domain-stats index a669f856..d3feb119 100755 --- a/bin/v-add-web-domain-stats +++ b/bin/v-add-web-domain-stats @@ -66,7 +66,8 @@ cat $WEBTPL/$type.tpl |\ > $HOMEDIR/$user/conf/web/$type.$domain.conf if [ "$type" == 'awstats' ]; then - ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf /etc/awstats/ + ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \ + /etc/awstats/$type.$domain_idn.conf fi diff --git a/bin/v-change-web-domain-stats b/bin/v-change-web-domain-stats index f4497440..ef8dd1cb 100755 --- a/bin/v-change-web-domain-stats +++ b/bin/v-change-web-domain-stats @@ -77,6 +77,11 @@ cat $WEBTPL/$type.tpl |\ -e "s/%alias_idn%/${aliases_idn//,/ }/g" \ > $HOMEDIR/$user/conf/web/$type.$domain.conf +if [ "$type" == 'awstats' ]; then + ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \ + /etc/awstats/$type.$domain_idn.conf +fi + #----------------------------------------------------------# # Vesta # diff --git a/bin/v-delete-web-domain-stats b/bin/v-delete-web-domain-stats index a6913099..c3398aab 100755 --- a/bin/v-delete-web-domain-stats +++ b/bin/v-delete-web-domain-stats @@ -13,6 +13,7 @@ # Argument defenition user=$1 domain=$(idn -t --quiet -u "$2" ) +domain_idn=$(idn -t --quiet -a "$domain") # Includes source $VESTA/conf/vesta.conf @@ -48,7 +49,7 @@ stats_dir="$HOMEDIR/$user/web/$domain/stats" rm -rf $stats_dir/* # Deleting config -rm -f /etc/awstats/$STATS.$domain.conf +rm -f /etc/awstats/$STATS.$domain_idn.conf rm -f $HOMEDIR/$user/conf/web/$STATS.$domain.conf diff --git a/bin/v-rebuild-web-domains b/bin/v-rebuild-web-domains index 9598ed10..374af8a5 100755 --- a/bin/v-rebuild-web-domains +++ b/bin/v-rebuild-web-domains @@ -136,9 +136,11 @@ for domain in $(shell_list) ; do -e "s/%alias_idn%/${aliases_idn//,/ }/g" \ > $HOMEDIR/$user/conf/web/$STATS.$domain.conf + if [ "$STATS" == 'awstats' ]; then - if [ ! -e "/etc/awstats/$STATS.$domain.conf" ]; then - ln -s $HOMEDIR/$user/conf/web/$STATS.$domain.conf /etc/awstats/ + if [ ! -e "/etc/awstats/$STATS.$domain_idn.conf" ]; then + ln -s $HOMEDIR/$user/conf/web/$STATS.$domain.conf \ + /etc/awstats/$STATS.$domain_idn.conf fi fi diff --git a/bin/v-update-web-domain-stat b/bin/v-update-web-domain-stat index cdaff937..289bbf50 100755 --- a/bin/v-update-web-domain-stat +++ b/bin/v-update-web-domain-stat @@ -62,7 +62,7 @@ build_webalizer() { build_awstats() { awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" wwwroot="/usr/share/awstats/wwwroot" - opts="-config=$domain -staticlinks -update -output" + opts="-config=$domain_idn -staticlinks -update -output" month=$(date "+%Y-%m") output='alldomains allhosts lasthosts unknownip allrobots lastrobots urldetail urlentry urlexit osdetail browserdetail unknownbrowser