#!/bin/bash set -e script_version="0.2b" rdate="12/07/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 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/compile source :\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 fi cd ~/cpuminer-multi ./build.sh cd ~/cpuminer-opt ./build.sh cd ~/cpuminer-xzc ./build.sh echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mAdd autostart miner_cpu.sh :\e[0m" if ! grep --quiet "su work -c '/home/work/miner_cpu.sh'" /etc/rc.local then sed -i "s/exit 0//g" /etc/rc.local RC_LOCAL_CMD0="su work -c '/home/work/miner_cpu.sh'" echo $RC_LOCAL_CMD0 >>/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 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"