Advertisement
Guest User

gtinstall.sh

a guest
Dec 8th, 2010
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.56 KB | None | 0 0
  1. # Install script for GeniusTrader onto Turnkey Linux LAMP
  2. #
  3.  
  4. # Add the user that is going to run GeniusTrader
  5. useradd --create-home --shell=/bin/bash gt
  6. echo "gt:password" | chpasswd
  7.  
  8. # 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
  9. mkdir /home/gt/geniustrader                                            
  10. cd /home/gt/geniustrader/
  11. wget http://www.geniustrader.org/download/geniustrader_r690.tgz
  12. cd ..
  13. tar xfz geniustrader/geniustrader_r690.tgz
  14. cd geniustrader/
  15. rm -rf Windows_Installer/
  16. cd ..
  17. chown -R gt:gt geniustrader
  18.  
  19. # Download and install the pre-requisites
  20. apt-get -y install libdate-calc-perl libgetargs-long-perl libxml-libxml-perl libcompress-zlib-perl libdate-manip-perl libgd-gd2-perl beancounter
  21. su - gt -c "echo yes | cpan GD"
  22.  
  23. # Setup MySQL
  24. mysql -u root -ppassword -e "grant all privileges on *.* to gt@localhost"
  25.  
  26. # Setup beancounter
  27. su - gt -c "setup_beancounter -m -s; update_beancounter -m"
  28.  
  29. # Download some data to get started with
  30. su - gt -c "beancounter --dbsystem MySQL --dbname beancounter addstock IBM"
  31. su - gt -c "beancounter --dbsystem MySQL --dbname beancounter backpopulate --prevdate '20 year ago' --date 'today' IBM"
  32. su - gt -c "beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today"
  33.  
  34. # Setup cron to download latest data every 4 hours into beancounter
  35. var="(crontab -l; echo \"0 */4 * * * beancounter --dbsystem MySQL --dbname beancounter update --forceupdate today\") | crontab -"
  36. su - gt -c "$var"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement