Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # yPool All-In-One EZ Setup Script
- # Hacked together by GigaWatt
- # Last Update: 25 July, 2013
- {
- YPOOL_USERNAME=""
- YPOOL_PASSWORD=""
- YPOOL_SIEVESIZE="2000000" # Default: 2000000
- YPOOL_PRIMES="400000" # Default: 400000
- echo "Building swapfile..."
- sudo dd if=/dev/zero of=/swapfile bs=64M count=16
- sudo mkswap /swapfile
- sudo swapon /swapfile
- echo "Installing dependencies..."
- apt-get install software-properties-common -y
- apt-add-repository ppa:ubuntu-wine/ppa -y
- apt-get update
- apt-get install wine1.5 winetricks -y
- echo "Downloading miner..."
- cat << "SCRIPT" > ~/build-miner
- #!/bin/bash
- [[ -f ~/stop-miner ]] && ./stop-miner
- rm ~/jh* ~/miner.zip
- wget http://ypool.net/files/jhprimeminer.zip -O ~/miner.zip
- unzip -o ~/miner.zip
- rm ~/miner.zip
- chmod +x ~/jhPrimeminer.exe
- SCRIPT
- chmod +x ~/build-miner
- ~/build-miner
- # Start miner
- echo "Building settings and scripts..."
- cat << SCRIPT > ~/miner
- #!/bin/bash
- cd ~
- cores=\$(cat /proc/cpuinfo | grep processor | wc -l)
- timeout 45m ./jhPrimeminer.exe -o http://ypool.net:10034 -u ${YPOOL_USERNAME} -p ${YPOOL_PASSWORD} -t \${cores} -s ${YPOOL_SIEVESIZE} -primes ${YPOOL_PRIMES}
- SCRIPT
- chmod +x ~/miner
- # Miner watchdog
- cat << "SCRIPT" > ~/start-miner
- #!/bin/bash
- echo Starting miner...
- killall --older-than 15s -q start-miner jhPrimeminer.exe wine wineconsole
- function background_loop
- while :; do
- ~/miner >/dev/null 2>&1
- sleep 3
- killall jhPrimeminer.exe wine wineconsole
- done
- sleep 1
- background_loop &
- SCRIPT
- chmod +x ~/start-miner
- ~/start-miner
- # Watchdog stopper
- cat << "SCRIPT" > ~/stop-miner
- #!/bin/bash
- echo Stopping miner...
- killall -q start-miner jhPrimeminer.exe wine wineconsole
- sleep 3
- SCRIPT
- chmod +x ~/stop-miner
- cat << "SCRIPT" > ~/peek
- #!/bin/bash
- ps fa -o pid,%cpu,%mem,cmd
- SCRIPT
- chmod +x ~/peek
- echo
- echo
- echo '=========================================================='
- echo 'All Done!'
- echo 'jhPrimeminer should be up and running!'
- echo
- echo 'Run ./start-miner to start mining'
- echo 'Run ./stop-miner to stop mining'
- echo 'Run ./build-miner to update and jhPrimeminer'
- echo 'Run ./peek to check on your mining status'
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement