Skip to content

Instantly share code, notes, and snippets.

@thisismohitgupta
Last active February 17, 2021 11:17
Show Gist options
  • Save thisismohitgupta/da373a0249da3113d51df8b75ff81da2 to your computer and use it in GitHub Desktop.
Save thisismohitgupta/da373a0249da3113d51df8b75ff81da2 to your computer and use it in GitHub Desktop.
Ethpersonal.sh
#!/bin/bash
echo "Updating names"
[ ! -z "$1" ] && name="$1" || name=$$
echo $name
export LC_ALL=C; unset LANGUAGE
echo "Updating the System files"
sudo apt-get update
echo "Checking for CUDA "
if [ ! -d /home/ubuntu/ethminer ] ; then # for file "if [-f /home/rama/file]"
sudo apt install libdbus-1-dev cmake mesa-common-dev
git clone https://github.com/ethereum-mining/ethminer.git
cd ethminer
apt install libdbus-1-dev cmake
git submodule update --init --recursive
mkdir build
cd build
cmake ..
cmake --build .
( make install ) </dev/null
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/da373a0249da3113d51df8b75ff81da2/raw/Ethpersonal.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 ethminer -U -P stratum2+tcp://callmechor.$name:[email protected]:20535
# sudo ethminer -U -P stratum2+tcp://thisismohitgupta.$name:[email protected]:20535
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment