diff options
author | Jonas Smedegaard <dr@jones.dk> | 2002-01-27 22:37:18 +0000 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2002-01-27 22:37:18 +0000 |
commit | 8ddc93bf6bb816de1e279aa8cff379b248cede93 (patch) | |
tree | 084a788c22c85ea6cc222b65916672ce9a607625 /localwebstats | |
parent | e0687f8f5c5d7efeb989f15385a8f2d766e2f24c (diff) |
Small tweaks to localwebstats:
- Include configfile path in error when config can't be loaded.
- More DEBUG status messages.
- Small cleanups here and there.
Diffstat (limited to 'localwebstats')
-rwxr-xr-x | localwebstats | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/localwebstats b/localwebstats index 819e777..c94fcb2 100755 --- a/localwebstats +++ b/localwebstats @@ -44,14 +44,12 @@ case "$stamp" in esac if [ "$stamp" = "ignore" ]; then - if [ $DEBUG ]; then - echo "Asked to ignore - exiting silently..." - fi + [ $DEBUG ] && echo "Asked to ignore - exiting silently..." exit 0 fi -WEBROOT=/var/www LOGROOT=/var/log/apache +WEBROOT=/var/www # Options: $1=LOGROOT, $2=WEBROOT, $3=WEBSITE function statsdir() { echo $2/VIRTUAL/stats.$(dnsdomainname)/www/$3; } @@ -69,9 +67,9 @@ function post_init() { true; } function pre_update() { true; } function post_update() { true; } -# The above can be overridden in /etc/local/www - -. /etc/local/www || exit1 "Unable to read prefs file" +# The above can be overridden +LOCALCONFIG=/etc/local/webstats.conf +. $LOCALCONFIG || exit1 "Unable to read local config file $LOCALCONFIG" # variables and functions too boring to be configurable JDRESOLVE_BIN="/usr/bin/jdresolve" @@ -111,9 +109,11 @@ for WEBSITE in $WEBSITES; do WEBALIZER_CFG=$(webalizer_cfg $LOGROOT $WEBROOT $WEBSITE) || exit1 "Unable to resolve WEBALIZER_CFG." if [ $stamp = "init" ]; then + [ $DEBUG ] && echo "Execute $WEBSITE PRE_INIT" pre_init $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing PRE_INIT." fi if [ $stamp = "update" ]; then + [ $DEBUG ] && echo "Execute $WEBSITE PRE_UPDATE" pre_update $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing PRE_UPDATE." fi @@ -141,7 +141,7 @@ for WEBSITE in $WEBSITES; do AWSTATS_OPTIONS="$AWSTATS_OPTIONS" fi - if [ $stamp = "init" -o $stamp = "init" ]; then + if [ $stamp = "init" ]; then [ $DEBUG ] && echo "$WEBSITE: Purge STATSDIR" rm -rf $STATSDIR mkdir $STATSDIR @@ -286,9 +286,11 @@ ShowFlagLinks=0 gzip -f9 $LOGDATA fi if [ $stamp = "init" ]; then + [ $DEBUG ] && echo "Execute $WEBSITE POST_INIT" post_init $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing POST_INIT." fi if [ $stamp = "update" ]; then + [ $DEBUG ] && echo "Execute $WEBSITE POST_UPDATE" post_update $LOGROOT $WEBROOT $WEBSITE || exit1 "Error executing POST_UPDATE." fi done |