Fixed webalizer and awstats support for Debian/Ubuntu

This commit is contained in:
Serghey Rodin 2013-11-04 23:45:50 +02:00
commit 6a80e6b218
3 changed files with 19 additions and 4 deletions

View file

@ -54,7 +54,10 @@ upd_web_domain_values
cat $WEBTPL/$type/$type.tpl |\ cat $WEBTPL/$type/$type.tpl |\
sed -e "s/%ip%/$ip/g" \ sed -e "s/%ip%/$ip/g" \
-e "s/%web_port%/$WEB_PORT/g" \ -e "s/%web_port%/$WEB_PORT/g" \
-e "s/%web_system%/$WEB_SYSTEM/g" \
-e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \ -e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \
-e "s/%rgroups%/$WEB_RGROUPS/g" \
-e "s/%proxy_system%/$PROXY_SYSTEM/g" \
-e "s/%proxy_port%/$PROXY_PORT/g" \ -e "s/%proxy_port%/$PROXY_PORT/g" \
-e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \ -e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \
-e "s/%domain_idn%/$domain_idn/g" \ -e "s/%domain_idn%/$domain_idn/g" \
@ -66,8 +69,11 @@ cat $WEBTPL/$type/$type.tpl |\
> $HOMEDIR/$user/conf/web/$type.$domain.conf > $HOMEDIR/$user/conf/web/$type.$domain.conf
if [ "$type" == 'awstats' ]; then if [ "$type" == 'awstats' ]; then
rm -f /etc/awstats/$type.$domain_idn.conf
ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \ ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \
/etc/awstats/$type.$domain_idn.conf /etc/awstats/$type.$domain_idn.conf
else
mkdir -p /var/lib/webalizer
fi fi

View file

@ -66,7 +66,10 @@ upd_web_domain_values
cat $WEBTPL/$type/$type.tpl |\ cat $WEBTPL/$type/$type.tpl |\
sed -e "s/%ip%/$ip/g" \ sed -e "s/%ip%/$ip/g" \
-e "s/%web_port%/$WEB_PORT/g" \ -e "s/%web_port%/$WEB_PORT/g" \
-e "s/%web_system%/$WEB_SYSTEM/g" \
-e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \ -e "s/%web_ssl_port%/$WEB_SSL_PORT/g" \
-e "s/%rgroups%/$WEB_RGROUPS/g" \
-e "s/%proxy_system%/$PROXY_SYSTEM/g" \
-e "s/%proxy_port%/$PROXY_PORT/g" \ -e "s/%proxy_port%/$PROXY_PORT/g" \
-e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \ -e "s/%proxy_ssl_port%/$PROXY_SSL_PORT/g" \
-e "s/%domain_idn%/$domain_idn/g" \ -e "s/%domain_idn%/$domain_idn/g" \
@ -78,8 +81,11 @@ cat $WEBTPL/$type/$type.tpl |\
> $HOMEDIR/$user/conf/web/$type.$domain.conf > $HOMEDIR/$user/conf/web/$type.$domain.conf
if [ "$type" == 'awstats' ]; then if [ "$type" == 'awstats' ]; then
rm -f /etc/awstats/$type.$domain_idn.conf
ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \ ln -s $HOMEDIR/$user/conf/web/$type.$domain.conf \
/etc/awstats/$type.$domain_idn.conf /etc/awstats/$type.$domain_idn.conf
else
mkdir -p /var/lib/webalizer
fi fi

View file

@ -60,8 +60,13 @@ build_webalizer() {
} }
build_awstats() { build_awstats() {
awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl" if [ -e "/etc/redhat-release" ]; then
wwwroot="/usr/share/awstats/wwwroot" awstats="/usr/share/awstats/wwwroot/cgi-bin/awstats.pl"
wwwroot="/usr/share/awstats/wwwroot"
else
awstats="/usr/lib/cgi-bin/awstats.pl"
wwwroot="/usr/share/awstats"
fi
opts="-config=$domain_idn -staticlinks -update -output" opts="-config=$domain_idn -staticlinks -update -output"
month=$(date "+%Y-%m") month=$(date "+%Y-%m")
output='alldomains allhosts lasthosts unknownip allrobots lastrobots output='alldomains allhosts lasthosts unknownip allrobots lastrobots
@ -116,8 +121,6 @@ build_awstats() {
11) month='November';; 11) month='November';;
12) month='December';; 12) month='December';;
esac esac
echo $month
select_m="$select_m<option value=$link>$month $year<\/option>\n" select_m="$select_m<option value=$link>$month $year<\/option>\n"
done done
cat $WEBTPL/awstats/nav.tpl | sed "s/%select_month%/$select_m/" >\ cat $WEBTPL/awstats/nav.tpl | sed "s/%select_month%/$select_m/" >\