
gtinstall.sh
By: a guest on
Dec 8th, 2010 | syntax:
Bash | size: 1.65 KB | hits: 62 | expires: Never
# Install script for GeniusTrader onto Turnkey Linux LAMP
#
# v 0.0.2 replaced installtion of libgd-gd2-perl with libgd2-xpm-dev to fix cpan problem
# Add the user that is going to run GeniusTrader
useradd --create-home --shell=/bin/bash gt
echo "gt:password" | chpasswd
# Create the directory where GeniusTrader is going to live, download GeniusTrader, extract from archive and tidy up, not forgetting to set gt as the owner
mkdir /home/gt/geniustrader
cd /home/gt/geniustrader/
wget http://www.geniustrader.org/download/geniustrader_r690.tgz
cd ..
tar xfz geniustrader/geniustrader_r690.tgz
cd geniustrader/
rm -rf Windows_Installer/
cd ..
chown -R gt:gt geniustrader
# Download and install the pre-requisites
apt-get -y install libdate-calc-perl libgetargs-long-perl libxml-libxml-perl libcompress-zlib-perl libdate-manip-perl libgd2-xpm-dev beancounter
su - gt -c "echo yes | cpan GD"
# Setup MySQL
mysql -u root -ppassword -e "grant all privileges on *.* to gt@localhost"
# Setup beancounter
su - gt -c "setup_beancounter -m -s; update_beancounter -m"
# Download some data to get started with
su - gt -c "beancounter --dbsystem MySQL --dbname beancounter addstock IBM"
su - gt -c "beancounter --dbsystem MySQL --dbname beancounter backpopulate --prevdate '20 year ago' --date 'today' IBM"
su - gt -c "beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today"
# Setup cron to download latest data every 4 hours into beancounter
var="(crontab -l; echo \"0 */4 * * * beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today\") | crontab -"
su - gt -c "$var"