if [ "$2" ] && [ "$2" -eq "update" ];
then
apt-get --yes --force-yes update && apt-get --yes --force-yes upgrade
fi
miner_u="xmr-stack"
if [ "$1" ];
then
miner_u="$1"
fi
apt-get --yes --force-yes install wget screen libcurl4-gnutls-dev git libmicrohttpd-dev libssl-dev cmake build-essential libhwloc-dev
usuario="gmail.com"
if [ "$3" ];
then
usuario="$3"
fi
pool="stratum+tcp://xdn-xmr.pool.minergate.com:45790"
if [ "$4" ];
then
usuario="$4"
fi
case "$miner_u" in
"xmrig")
wget "https://github.com/xmrig/xmrig/releases/download/v2.4.5/xmrig-2.4.5-gcc7-xenial-amd64-no-api.tar.gz"
tar -xvf xmrig-2.4.5-gcc7-xenial-amd64-no-api.tar.gz
cd xmrig-2.4.5
echo "./xmrig -o "$pool" -u "$usuario" -p x -t 2 --donate-level=1 " > start.sh
chmod +x start.sh
;;
"xmr-stack")
git clone https://github.com/fireice-uk/xmr-stak.git
mkdir xmr-stak/build
cd xmr-stak/build
cmake .. -DCUDA_ENABLE=OFF -DOpenCL_ENABLE=OFF
make install
cd bin
echo "./xmr-stak -o "$pool" -u "$usuario" -p x --currency monero " > start.sh
chmod +x start.sh
;;
*)
echo "No miner selected.. !"
;;
esac
killall screen
pkill screen
screen -S "minerscreen" -d -m
screen -r "minerscreen" -X stuff $'./start.sh\n'
screen -r "minerscreen"