#!/bin/bash sudo apt-get -y install git autoconf automake libcurl4-openssl-dev make gcc git clone https://github.com/siklon/shinyminer.git shinyminer cd shinyminer ./autogen.sh ./configure make cd /home/ubuntu echo '\ if [ ! -f /home/ubuntu/ADDRESS ]; then echo Must store address in /home/ubuntu/ADDRESS exit 1 fi if [ ! -f /home/ubuntu/NUM_THREADS ]; then echo Must store number of ramhog threads in /home/ubuntu/NUM_THREADS exit 1 fi RUNNING=`screen -ls | grep miner | wc -l` if [ "$RUNNING" -ne "0" ]; then echo Miner is already running exit 0 fi ADDR=`cat /home/ubuntu/ADDRESS` THREADS=`cat /home/ubuntu/NUM_THREADS` if [ "$RUNNING" -eq "0" ]; then echo Mining to $ADDR with $THREADS threads screen -dmLS miner /home/ubuntu/shinyminer/minerd -o stratum+tcp://106.3.225.46:6666 -O $ADDR:x -t $THREADS fi' > /home/ubuntu/start_miner echo "screen -S miner -X quit" > /home/ubuntu/stop_miner chmod a+x /home/ubuntu/start_miner chmod a+x /home/ubuntu/stop_miner echo "@reboot /home/ubuntu/start_miner" | crontab - /home/ubuntu/start_miner