awstatic.sh - Generate static awstats reports

Printer-friendly versionPrinter-friendly version
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/bash
 
# samu 2010-02-23
 
STATIC_DEST="/var/www/awstats/static"
 
cat > "$STATIC_DEST/index.html" << EOF
<html><head><title>AWSTATS - Static</title></head><body>
<h1>AWSTATS - Static Statistics</h1>
<ul>
EOF
 
for conf in $( ls /etc/awstats/ | grep "^awstats\..*\.conf\$" | sed "s/^awstats\.\(.*\).conf\$/\1/" ); do
  echo "Generating static pages for $conf ..."
  if [ ! -e "${STATIC_DEST}/${conf}" ]; then
    mkdir -p "${STATIC_DEST}/${conf}"
  fi
  /usr/share/doc/awstats/examples/awstats_buildstaticpages.pl -awstatsprog=/usr/lib/cgi-bin/awstats.pl -dir="${STATIC_DEST}/${conf}" -config="$conf" -buildpdf 2>&1 | sed "s/^/  /"
  echo "<li><a href='${conf}/awstats.${conf}.html'>${conf}</a> [<a href='${conf}/awstats.${conf}.pdf'>PDF</a>]</li>" >> "$STATIC_DEST/index.html"
done
 
cat >> "$STATIC_DEST/index.html" << EOF
</ul>
<hr />
<div><em>Last update: $( date +"%F %T" )</em></div>
</body></html>
EOF

1 comment

 
Anonymous wrote 4 weeks 2 days ago

re

I will recommend not to wait until you get enough amount of cash to order different goods! You should take the www.lowest-rate-loans.com or credit loan and feel yourself free

Who Am I?

~redShadow~ A.K.A. Samuele Santi is an Italian Open Source developer, currently working as a freelance developer, mainly in the web applications sector. Favourite programming languages: PHP and, of course, Python!

3d (3) backup (3) documentation (2) e-mail (2) development (11) cocktails (1) blogroll (7) Drupal (21) Drupal Forms (1) apache (1) dmcrypt (1) alcool (1) citroen (1) cartoons (1) 2v (1) awstats (3) arduino (1) debug (1) audio (1) C++ (2) doku (1) apt (1) aoe (1) debian (1) caos (1) aircrack (1) curl (1) address book (2) cars (1) como lake rovers (1) code (3) bash (11) camera mia (1) algorythms (1) circuits (1) database (3) contact manager (1) archive (1) blender (3) cryptography (1)