[Pkg-awstats-commits] [SCM] awstats Debian packaging branch, master, updated. debian/6.9.5.dfsg-2-5-g7774d56
Sergey B Kirpichev
skirpichev at gmail.com
Tue May 18 14:44:22 UTC 2010
The following commit has been merged in the master branch:
commit 7774d568ed1e9322b777cf9b2ca16c1383c54c2a
Author: Sergey B Kirpichev <skirpichev at gmail.com>
Date: Tue May 18 18:43:21 2010 +0400
Cosmetic improvements to cron scripts (Closes: #580704)
diff --git a/debian/buildstatic.sh b/debian/buildstatic.sh
index a2fa769..87be522 100755
--- a/debian/buildstatic.sh
+++ b/debian/buildstatic.sh
@@ -1,6 +1,6 @@
#!/bin/sh
##
-## buildstatic.sh, written by Sergey B Kirpichev <skirpichev at gmail.com>
+## buildstatic.sh, written by Sergey B Kirpichev <skirpichev at gmail.com>
##
## Build all static html reports from AWStats data (Debian specific)
##
@@ -11,11 +11,17 @@ DEFAULT=/etc/default/awstats
AWSTATS=/usr/lib/cgi-bin/awstats.pl
BUILDSTATICPAGES=/usr/share/awstats/tools/awstats_buildstaticpages.pl
ERRFILE=`mktemp /tmp/awstats.XXXXXXXXXX`
+YEAR=`date +%Y`
+MONTH=`date +%m`
trap 'rm -f $ERRFILE' INT QUIT TERM EXIT
[ -f $AWSTATS -a -f $BUILDSTATICPAGES ] || exit 1
+# Set default
+AWSTATS_NICE=10
+AWSTATS_ENABLE_BUILDSTATICPAGES="yes"
+AWSTATS_LANG="en"
[ -r "$DEFAULT" ] && . "$DEFAULT"
[ "$AWSTATS_ENABLE_BUILDSTATICPAGES" == "yes" ] || exit 0
@@ -26,16 +32,15 @@ for c in awstats \
`/bin/ls -1 awstats.*.conf 2>/dev/null | \
/bin/sed 's/^awstats\.\(.*\)\.conf/\1/'`
do
- Y=`date +%Y`
- m=`date +%m`
- mkdir -p /var/cache/awstats/$c/$Y/$m/
+ mkdir -p /var/cache/awstats/$c/$YEAR/$MONTH/
+
if ! nice -n $AWSTATS_NICE $BUILDSTATICPAGES \
-config=$c \
- -year=$Y \
- -month=$m \
+ -year=$YEAR \
+ -month=$MONTH \
-lang=$AWSTATS_LANG \
-staticlinksext=${AWSTATS_LANG}.html \
- -dir=/var/cache/awstats/$c/$Y/$m/ >$ERRFILE 2>&1
+ -dir=/var/cache/awstats/$c/$YEAR/$MONTH/ >$ERRFILE 2>&1
then
cat $ERRFILE >&2 # an error occurred
fi
diff --git a/debian/update.sh b/debian/update.sh
index 75f2454..4fbcc20 100755
--- a/debian/update.sh
+++ b/debian/update.sh
@@ -1,6 +1,6 @@
#!/bin/sh
##
-## update.sh, written by Sergey B Kirpchev <skirpichev at gmail.com>
+## update.sh, written by Sergey B Kirpichev <skirpichev at gmail.com>
##
## Update AWStats data for all configs, awstats.*.conf (Debian specific)
##
@@ -15,6 +15,8 @@ trap 'rm -f $ERRFILE' INT QUIT TERM EXIT
[ -f $AWSTATS ] || exit 1
+# Set defaults.
+AWSTATS_NICE=10
[ -r "$DEFAULT" ] && . "$DEFAULT"
cd /etc/awstats
--
awstats Debian packaging
More information about the Pkg-awstats-commits
mailing list