wok-6.x diff awstats-hotspot/stuff/loghotspot.sh @ rev 22513

updated atftp and atftpd (0.7 -> 0.7.2)
author Hans-G?nter Theisgen
date Wed Jan 01 16:03:49 2020 +0100 (2020-01-01)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/awstats-hotspot/stuff/loghotspot.sh	Wed Jan 01 16:03:49 2020 +0100
     1.3 @@ -0,0 +1,36 @@
     1.4 +#!/bin/sh
     1.5 +
     1.6 +HOTSPOT="hotspot"
     1.7 +DIRDATA="/var/lib/awstats/$HOTSPOT"
     1.8 +
     1.9 +if [ "$1" == "--install" ]; then
    1.10 +	cp /etc/awstats/awstats.model.conf /etc/awstats/awstats.$HOTSPOT.conf
    1.11 +	while read line; do
    1.12 +		sed -i "s,^${line%=*}.*,$line," /etc/awstats/awstats.$HOTSPOT.conf
    1.13 +	done <<EOT
    1.14 +LogFile="$0 < /var/log/squid/access.log |"
    1.15 +LogFormat="%code %time4 %bytesd %method %query %host %url"
    1.16 +SiteDomain="$HOTSPOT"
    1.17 +DirData="$DIRDATA"
    1.18 +LevelForBrowsersDetection=0
    1.19 +LevelForOSDetection=0
    1.20 +LevelForRefererAnalyze=0
    1.21 +LevelForRobotsDetection=0
    1.22 +LevelForSearchEnginesDetection=0
    1.23 +LevelForKeywordsDetection=0
    1.24 +ShowRobotsStats=0
    1.25 +ShowOSStats=0
    1.26 +ShowBrowsersStats=0
    1.27 +ShowOriginStats=0
    1.28 +ShowKeyphrasesStats=0
    1.29 +ShowKeywordsStats=0
    1.30 +ShowMiscStats=0
    1.31 +ShowHTTPErrorsStats=0
    1.32 +EOT
    1.33 +else
    1.34 +	while read time skip1 iprouter skip2 bytesd method query skip3 ; do
    1.35 +		host=$(echo $query | sed 's#.*//\([^/]*\)/.*#\1#')
    1.36 +		url=$(echo $query | sed 's#.*//##')
    1.37 +		echo "200 ${time%.*} $bytesd $method $query $host $url"
    1.38 +	done
    1.39 +fi