wok-next view awstats-hotspot/stuff/loghotspot.sh @ rev 20806
I. node update: security -> https://nodejs.org/en/blog/vulnerability/june-2018-security-releases/ 9.5.0 -> 9.11.2 II. add checksum
author | Erkan Yilmaz <erkan@slitaz.org> |
---|---|
date | Wed Jun 13 08:26:54 2018 +0000 (2018-06-13) |
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