#!/bin/bash set -e script_version="1.50b" rdate="22/12/2018" remote_folder="http://wareck.free.fr/openrig" if [ $UID -ne 0 ] then echo -e "\n\e[91mPlease run this script as ROOT : sudo ./setup.sh \e[0m" echo sleep 1 exit fi echo "" echo -n -e " \e[97m\u2554" for i in {1..36}; do echo -e -n "\u2550"; done echo -e "\u2557\e[0m" echo -e " \e[97m\u2551 CPU mining Auto-install \e[93m"V$script_version"\e[0m\e[97m \u2551\e[0m" echo -e " \e[97m\u2551 Release date: \e[93m"$rdate"\e[0m\e[97m \u2551\e[0m" echo -e " \e[97m\u2551 wareck@gmail.com \u2551\e[0m" echo -n -e " \e[97m\u255A" for j in {1..36}; do echo -e -n "\u2550";done echo -e -n "\u255D\e[0m" echo echo -e "\n\e[95mSystem Update :\e[0m" sudo apt-get update sudo apt-get install automake autoconf libtool libmicrohttpd-dev libjansson-dev cmake pkg-config libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev make g++ -y echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mDownload sources :\e[0m" cd ~ if ! [ -d cpuminer-multi ] then git clone https://github.com/tpruvot/cpuminer-multi.git && echo fi if ! [ -d cpuminer-opt ] then git clone https://github.com/JayDDee/cpuminer-opt.git && echo fi if ! [ -d cpuminer-xzc ] then git clone https://github.com/aizensou/cpuminer-xzc.git && echo fi if ! [ -d xmrig_cpu ] then git clone https://github.com/xmrig/xmrig.git xmrig_cpu fi echo -e "\n\e[95mBuild cpuminer-multi:\e[0m" cd ~/cpuminer-multi ./build.sh echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mBuild cpuminer-opt:\e[0m" cd ~/cpuminer-opt ./build.sh echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mBuild cpuminer-xzc:\e[0m" cd ~/cpuminer-xzc ./build.sh echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mInstall xmrig-cpu:\e[0m" cd ~ cd /tmp/ if ! [ -d libuv ]; then git clone https://github.com/libuv/libuv.git ;fi cd libuv ./autogen.sh ./configure make -j $(nproc) sudo make install sudo ldconfig cd ~ cd xmrig_cpu if ! [ -f patch_donate.patch ] then cat <<'EOF'>> patch_donate.patch diff --git a/src/donate.h b/src/donate.h index 46f26b7..67a9cb0 100644 --- a/src/donate.h +++ b/src/donate.h @@ -43,8 +43,8 @@ * XMR: 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8n$ * BTC: 1P7ujsXeX7GxQwHNnJsRMgAdNkFZmNVqJT */ -constexpr const int kDefaultDonateLevel = 5; -constexpr const int kMinimumDonateLevel = 1; +constexpr const int kDefaultDonateLevel = 0; +constexpr const int kMinimumDonateLevel = 0; #endif /* __DONATE_H__ */ EOF patch -p1 >/etc/rc.local echo "exit 0" >>/etc/rc.local fi echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mbuild miner_cpu.sh:\e[0m" cd ~ if [ -f miner_cpu.sh ]; then rm miner_cpu.sh; fi cat <<'EOF'>> miner_cpu.sh #!/bin/bash # version 1.0 12/07/2018 screen -S cpu -X quit ##-------MINER----- echo "start cpuminer." ## Lyra2z #screen -dmS cpu ~/cpuminer-xzc/cpuminer -a Lyra2z -o stratum+tcp://lyra2z.in.nicehash.com:3365 -u 16F8V2EnHCNPVQwTGLifGHCE12XTnWPG8G -p password #screen -dmS cpu ~/cpuminer-opt/cpuminer -a Lyra2z -o stratum+tcp://lyra2z.eu.nicehash.com:3365 -u 16F8V2EnHCNPVQwTGLifGHCE12XTnWPG8G -p password ## cryptonightv7 screen -dmS cpu ~/xmrig-cpu -o cryptonightv7.eu.nicehash.com:3363 -u 16F8V2EnHCNPVQwTGLifGHCE12XTnWPG8G.OpenRig -p x & # cryptonightheavy #screen -dmS cpu ~/xmrig-cpu -o cryptonightheavy.eu.nicehash.com:3364 -u 16F8V2EnHCNPVQwTGLifGHCE12XTnWPG8G.OpenRig -p x -a cryptonight-heavy # cryptonightv8 #screen -dmS cpu ~/xmrig-cpu -o stratum+tcp://cryptonightv8.eu.nicehash.com:3367 -u 16F8V2EnHCNPVQwTGLifGHCE12XTnWPG8G.OpenRig -p x -a cryptonight --variant 2 & echo "use 'screen -x cpu' to see miner activity" EOF chown work miner_cpu.sh chmod +x miner_cpu.sh echo -e "\e[97mDone !\e[0m" echo