@@ -60,46 +60,70 @@ build_webalizer() {
6060}
6161
6262build_awstats () {
63- awstats=" /var/www/awstats"
64- awstats_options=" -config=$config -staticlinks -update -output"
63+ awstats=" /usr/share/awstats/wwwroot/cgi-bin/awstats.pl"
64+ wwwroot=" /usr/share/awstats/wwwroot"
65+ opts=" -config=$domain -staticlinks -update -output"
6566 month=$( date " +%Y-%m" )
66- output=' alldomains allhosts lasthosts unknownip allrobots lastrobots
67- session urldetail urlentry urlexit osdetail unknownos
68- browserdetail unknownbrowser refererse refererpages keyphrases
69- keywords errors404'
67+ output=' alldomains allhosts lasthosts unknownip allemails lastemails
68+ allemailr lastemailr alllogins lastlogins allrobots lastrobots
69+ urldetail urldetail:filter urlentry urlentry:filter urlexit
70+ urlexit:filter osdetail browserdetail unknownbrowser unknownos
71+ refererse refererpages keyphrases keywords errors404 allextraX'
7072
7173 # Checking statistics directory
7274 if [ ! -e " $dir /$month " ]; then
7375 mkdir -p $dir /$month
7476 fi
7577
78+ # Logo check
79+ if [ ! -e " $dir /logo.png" ]; then
80+ cp -r $VESTA /web/images/logo.png $dir /
81+ fi
82+
7683 # Icon directory check
7784 if [ ! -e " $dir /icon" ]; then
78- cp -r $awstats /icon $dir /
85+ cp -r $wwwroot /icon $dir /
7986 fi
8087
8188 # Creating main awstats page
82- $awstats /awstats.pl $awstats_options | \
83- sed -e " s%awstats.$config .%%g" > $dir /$month /index.html
89+ $awstats $opts | sed -e " s%awstats.$domain .%%g" > $dir /$month /index.html
8490
8591 # Creating suplemental awstats pages
8692 for format in $output ; do
87- $awstats /awstats.pl $awstats_options =$format | \
88- sed -e " s%awstats.$config .%%g" > $dir /$month /$format .html
93+ $awstats $opts =$format | \
94+ sed -e " s%awstats.$domain .%%g" > $dir /$month /$format .html
8995 done
9096
9197 # Creating index page
92- cat $WEBTPL /awstats_index.tpl | sed -e " s/%month%/$month /g" \
93- > $dir /index.html
98+ cat $WEBTPL /awstats_index.tpl | sed -e " s/%month%/$month /g" > \
99+ $dir /index.html
94100
95101 # Creating navigation page
96102 months=$( find $dir -type d | sed -e " s%$dir /%%g" -e " s%$dir %%g" | \
97- grep -v icon | sort -r )
103+ grep -v icon | sort -r )
98104 for link in $months ; do
99- select_m=" $select_m \t <option value=\" $link \" >$link <\/option>\n"
105+ year=$( echo $link | cut -f 1 -d \- )
106+ month=$( echo $link | cut -f 2 -d \- )
107+ case " $month " in
108+ 1) month=' January' ;;
109+ 2) month=' February' ;;
110+ 3) month=' March' ;;
111+ 4) month=' April' ;;
112+ 5) month=' May' ;;
113+ 6) month=' June' ;;
114+ 7) month=' July' ;;
115+ 8) month=' August' ;;
116+ 9) month=' September' ;;
117+ 10) month=' October' ;;
118+ 11) month=' November' ;;
119+ 12) month=' December' ;;
120+ esac
121+ echo $month
122+
123+ select_m=" $select_m <option value=$link >$month $year <\/option>\n"
100124 done
101- cat $WEBTPL /awstats_nav.tpl | sed -e " s/%select_month%/$select_m /" \
102- > $dir /nav.html
125+ cat $WEBTPL /awstats_nav.tpl | sed -e " s/%select_month%/$select_m /" > \
126+ $dir /nav.html
103127
104128}
105129
0 commit comments