Advertisement
gigawatt

yPool VPS Guide

Jul 31st, 2013
426
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.18 KB | None | 0 0
  1. # yPool All-In-One EZ Setup Script
  2. # Hacked together by GigaWatt
  3. # Last Update: 25 July, 2013
  4.  
  5. {
  6. YPOOL_USERNAME=""
  7. YPOOL_PASSWORD=""
  8. YPOOL_SIEVESIZE="2000000" # Default: 2000000
  9. YPOOL_PRIMES="400000"     # Default: 400000
  10.  
  11. echo "Building swapfile..."
  12. sudo dd if=/dev/zero of=/swapfile bs=64M count=16
  13. sudo mkswap /swapfile
  14. sudo swapon /swapfile
  15.  
  16.  
  17. echo "Installing dependencies..."
  18. apt-get install software-properties-common -y
  19. apt-add-repository ppa:ubuntu-wine/ppa -y
  20. apt-get update
  21. apt-get install wine1.5 winetricks -y
  22.  
  23. echo "Downloading miner..."
  24. cat << "SCRIPT" > ~/build-miner
  25. #!/bin/bash
  26. [[ -f ~/stop-miner ]] && ./stop-miner
  27. rm ~/jh* ~/miner.zip
  28. wget http://ypool.net/files/jhprimeminer.zip -O ~/miner.zip
  29. unzip -o ~/miner.zip
  30. rm ~/miner.zip
  31. chmod +x ~/jhPrimeminer.exe
  32. SCRIPT
  33. chmod +x ~/build-miner
  34. ~/build-miner
  35.  
  36. # Start miner
  37. echo "Building settings and scripts..."
  38. cat << SCRIPT > ~/miner
  39. #!/bin/bash
  40. cd ~
  41. cores=\$(cat /proc/cpuinfo | grep processor | wc -l)
  42. timeout 45m ./jhPrimeminer.exe -o http://ypool.net:10034 -u ${YPOOL_USERNAME} -p ${YPOOL_PASSWORD} -t \${cores} -s ${YPOOL_SIEVESIZE} -primes ${YPOOL_PRIMES}
  43. SCRIPT
  44. chmod +x ~/miner
  45.  
  46. # Miner watchdog
  47. cat << "SCRIPT" > ~/start-miner
  48. #!/bin/bash
  49. echo Starting miner...
  50. killall --older-than 15s -q start-miner jhPrimeminer.exe wine wineconsole
  51. function background_loop
  52.     while :; do
  53.         ~/miner >/dev/null 2>&1
  54.         sleep 3
  55.         killall jhPrimeminer.exe wine wineconsole
  56.     done
  57. sleep 1
  58. background_loop &
  59. SCRIPT
  60. chmod +x ~/start-miner
  61. ~/start-miner
  62.  
  63. # Watchdog stopper
  64. cat << "SCRIPT" > ~/stop-miner
  65. #!/bin/bash
  66. echo Stopping miner...
  67. killall -q start-miner jhPrimeminer.exe wine wineconsole
  68. sleep 3
  69. SCRIPT
  70. chmod +x ~/stop-miner
  71.  
  72. cat << "SCRIPT" > ~/peek
  73. #!/bin/bash
  74. ps fa -o pid,%cpu,%mem,cmd
  75. SCRIPT
  76. chmod +x ~/peek
  77.  
  78. echo
  79. echo
  80. echo '=========================================================='
  81. echo 'All Done!'
  82. echo 'jhPrimeminer should be up and running!'
  83. echo
  84. echo 'Run ./start-miner   to start mining'
  85. echo 'Run ./stop-miner    to stop mining'
  86. echo 'Run ./build-miner   to update and jhPrimeminer'
  87. echo 'Run ./peek          to check on your mining status'
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement