Skip to content

Instantly share code, notes, and snippets.

@thisismohitgupta
Last active August 11, 2020 18:02
Show Gist options
  • Save thisismohitgupta/fb561d1c08e581fdd02833f1ed4315a0 to your computer and use it in GitHub Desktop.
Save thisismohitgupta/fb561d1c08e581fdd02833f1ed4315a0 to your computer and use it in GitHub Desktop.
Eth 2.0 Miner
#!/bin/bash
echo "Updating names"
[ ! -z "$1" ] && name="$1" || name=$$
echo $name
echo "Updating the System files"
sudo apt-get update
echo "Checking for CUDA "
if [ ! -f /home/ubuntu/ethminer ] ; then # for file "if [-f /home/rama/file]"
sudo apt install libdbus-1-dev cmake mesa-common-dev
wget https://github.com/thisismohitgupta/ethminer/releases/download/18/ethminer
sudo chmod +x /home/ubuntu/ethminer
fi
if ! dpkg-query -W supervisor; then
sudo apt-get install supervisor -y
sudo service supervisor start
cd /home/ubuntu
# install supervisor
echo "#!/bin/bash
wget -O - -q --no-cache 'https://gist.githubusercontent.com/thisismohitgupta/fb561d1c08e581fdd02833f1ed4315a0/raw/Eth2.sh' | sudo bash -s $name
" > run.sh
sudo chmod +x run.sh
echo "[program:mine]
command=/home/ubuntu/run.sh
autostart=true
autorestart=true
stderr_logfile=/var/log/long.err.log
stdout_logfile=/var/log/long.out.log" > /etc/supervisor/conf.d/mine.conf
sudo supervisorctl reread
sudo supervisorctl update
sudo reboot
fi
sudo /home/ubuntu/ethminer -U -P stratum2+tcp://callmechor.$name:[email protected]:20535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment