Don't like ads? PRO users don't see any ads ;-)
Guest

gtinstall.sh

By: a guest on Dec 8th, 2010  |  syntax: Bash  |  size: 1.65 KB  |  hits: 62  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Install script for GeniusTrader onto Turnkey Linux LAMP
  2. #
  3. # v 0.0.2 replaced installtion of libgd-gd2-perl with libgd2-xpm-dev to fix cpan problem
  4.  
  5. # Add the user that is going to run GeniusTrader
  6. useradd --create-home --shell=/bin/bash gt
  7. echo "gt:password" | chpasswd
  8.  
  9. # 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
  10. mkdir /home/gt/geniustrader                                            
  11. cd /home/gt/geniustrader/
  12. wget http://www.geniustrader.org/download/geniustrader_r690.tgz
  13. cd ..
  14. tar xfz geniustrader/geniustrader_r690.tgz
  15. cd geniustrader/
  16. rm -rf Windows_Installer/
  17. cd ..
  18. chown -R gt:gt geniustrader
  19.  
  20. # Download and install the pre-requisites
  21. apt-get -y install libdate-calc-perl libgetargs-long-perl libxml-libxml-perl libcompress-zlib-perl libdate-manip-perl libgd2-xpm-dev beancounter
  22. su - gt -c "echo yes | cpan GD"
  23.  
  24. # Setup MySQL
  25. mysql -u root -ppassword -e "grant all privileges on *.* to gt@localhost"
  26.  
  27. # Setup beancounter
  28. su - gt -c "setup_beancounter -m -s; update_beancounter -m"
  29.  
  30. # Download some data to get started with
  31. su - gt -c "beancounter --dbsystem MySQL --dbname beancounter addstock IBM"
  32. su - gt -c "beancounter --dbsystem MySQL --dbname beancounter backpopulate --prevdate '20 year ago' --date 'today' IBM"
  33. su - gt -c "beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today"
  34.  
  35. # Setup cron to download latest data every 4 hours into beancounter
  36. var="(crontab -l; echo \"0 */4 * * * beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today\") | crontab -"
  37. su - gt -c "$var"