#! /bin/bash
#? Encoding:			UTF-8
#? Name:			install_eStats.sh
#? Description:			just use `sh install_eStats.sh` and... ;-)
#? Version:			0.1
#? Date:			2009.11.23
#? Copyright:			2009, Walerian "Cobra" Walawski
#? Contact:			http://walerian.info/
#? License:			GPL 3, http://www.gnu.org/licenses/gpl.txt

# Help
if [ "$1" = "" ] || [ "$1" = "--help" ] || [ "$1" = "-h" ] || [ "$1" = "?" ]
then
	cat $0 | grep "#``? "
	exit 0
fi

# Install
echo 'Downloading eStats files...'
wget -q --output-document=eStats.stable.tar.bz2 http://estats.emdek.cba.pl/index.php?path=pl/download/stable-tar.bz2
echo 'Extracting eStats files...'
tar -xjf eStats.stable.tar.bz2
echo 'Setting permissions for eStats files...'
touch estats/conf/config.php
chmod 666 estats/conf/config.php
chmod 777 estats/data
chmod 777 estats/data/backups
chmod 777 estats/data/cache
chmod 777 estats/data/tmp
echo 'Files ready, open eStats in you web browser ;-)'

