From 3ef4189d9badf84700e7450525c094be1ff18c43 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Thu, 17 Jan 2002 17:09:42 +0000 Subject: localwebstats: use find instead of ls (no complaints with empty result). --- localwebstats | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'localwebstats') diff --git a/localwebstats b/localwebstats index fae1e35..819e777 100755 --- a/localwebstats +++ b/localwebstats @@ -53,12 +53,12 @@ fi WEBROOT=/var/www LOGROOT=/var/log/apache -# $1=LOGROOT, $2=WEBROOT and $3 is WEBSITE +# Options: $1=LOGROOT, $2=WEBROOT, $3=WEBSITE function statsdir() { echo $2/VIRTUAL/stats.$(dnsdomainname)/www/$3; } function webdirs() { find $1 -type d -mindepth 1 -maxdepth 1 | grep '\.*\.' | sed 's!$1!!'; } #function logfiles() { $(ls -r $LOGDIR/*-access*.gz) $(ls -r $LOGDIR/access*.??.gz) $(ls -r $LOGDIR/access*.?.gz) $(ls -r $LOGDIR/access*.?); } -function logcontentresolved() { for file in $(ls $1/$3/????.??.00.gz); do zcat $file; done; for file in $(ls $1/$3/????.??.00); do cat $file; done; } -function logcontent() { for file in $(ls $1/$3/????.??.??.gz | grep -v '\.00\.gz$'); do zcat $file; done; for file in $(ls $1/$3/????.??.?? | grep -v '\.00$'); do cat $file; done; } +function logcontentresolved() { for file in $(find $1/$3 -name '????.??.00.gz' -type f -mindepth 1 -maxdepth 1 -follow); do zcat $file; done; for file in $(find $1/$3 -name '????.??.00' -type f -mindepth 1 -maxdepth 1 -follow); do cat $file; done; } +function logcontent() { for file in $(find $1/$3 -name '????.??.??.gz' ! -name '*00.gz' -type f -mindepth 1 -maxdepth 1 -follow); do zcat $file; done; for file in $(find $1/$3 -name '????.??.??' ! -name '*00' -type f -mindepth 1 -maxdepth 1 -follow); do cat $file; done; } function host() { cat $2/VIRTUAL/$3/hostname || exit1 "Unable to get hostname for virtual host."; } function domain() { cat $2/VIRTUAL/$3/domainname || exit1 "Unable to get domainname for virtual host."; } function analog_cfg() { echo /etc/analog_$3.conf; } -- cgit v1.2.3