#!/bin/sh VER="6.5" # Need to be updated to match the version number you want to download SRC="awstats-$VER/" CGI="$SRC/wwwroot/cgi-bin" DEST="/usr/local/apache2/cgi-bin/stats" # Need to be updated to match your destination directory echo "##########################################" echo "Upgrading awstats to version: $VER" echo "Please send feedback through the interface at http://www.kfwebs.net/contact.php" echo "Original location: http://www.kfwebs.net/files/AWStats.upgrade.sh.txt" echo "##########################################" echo "Deleting duplicates" rm -rf awstats-$VER.tgz echo "Downloading new sources" wget http://awstats.sourceforge.net/files/awstats-$VER.tar.gz echo "Backing up old awstats dir" cp -Rf $DEST stats-backup-$VER echo "Unarchiving new source" tar zxvf awstats-$VER.tar.gz echo "Copying files" cp -f $CGI/awstats.pl $DEST/ cp -Rf $CGI/lib $DEST/ cp -Rf $CGI/lang $DEST/ cp -Rf $CGI/plugins $DEST/ cp -Rf $SRC/wwwroot/icon $DEST/ cp -Rf $SRC/tools $DEST/ cp -f $SRC/wwwroot/js/awstats*mis*.js /webs/kfwebs/js/ # Need to be updated to match your JavaScript directory echo "Update binary syntaxes"; perl -pi -e 's/KB/KiB/g' $DEST/lang/*.txt perl -pi -e 's/MB/MiB/g' $DEST/lang/*.txt perl -pi -e 's/GB/GiB/g' $DEST/lang/*.txt perl -pi -e 's/TB/TiB/g' $DEST/lang/*.txt echo "Cleaning up" rm -f awstats-$VER.tgz rm -rf awstats-$VER echo "##########################################" echo "Upgrading completed"