wok-next view awstats-hotspot/stuff/loghotspot.sh @ rev 16100
Up php (5.4.26) with CVE-2014-1943 fix
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Mar 17 11:15:00 2014 +0000 (2014-03-17) |
parents | |
children |
line source
1 #!/bin/sh
3 HOTSPOT="hotspot"
4 DIRDATA="/var/lib/awstats/$HOTSPOT"
6 if [ "$1" == "--install" ]; then
7 cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.$HOTSPOT.conf
8 while read line; do
9 sed -i "s,^${line%=*}.*,$line," /etc/awstats/awstats.$HOTSPOT.conf
10 done <<EOT
11 LogFile="$0 < /var/log/squid/access.log |"
12 LogFormat="%code %time4 %bytesd %method %query %host %url"
13 SiteDomain="$HOTSPOT"
14 DirData="$DIRDATA"
15 LevelForBrowsersDetection=0
16 LevelForOSDetection=0
17 LevelForRefererAnalyze=0
18 LevelForRobotsDetection=0
19 LevelForSearchEnginesDetection=0
20 LevelForKeywordsDetection=0
21 ShowRobotsStats=0
22 ShowOSStats=0
23 ShowBrowsersStats=0
24 ShowOriginStats=0
25 ShowKeyphrasesStats=0
26 ShowKeywordsStats=0
27 ShowMiscStats=0
28 ShowHTTPErrorsStats=0
29 EOT
30 else
31 while read time skip1 iprouter skip2 bytesd method query skip3 ; do
32 host=$(echo $query | sed 's#.*//\([^/]*\)/.*#\1#')
33 url=$(echo $query | sed 's#.*//##')
34 echo "200 ${time%.*} $bytesd $method $query $host $url"
35 done
36 fi