#!/bin/bash set -e script_version="1.54" rdate="20/02/2019" remote_folder="http://wareck.free.fr/openrig" lsb_v="`lsb_release -r | awk '{print$2; exit}'`" lsb_r="`lsb_release -d | awk '{print$2" "$3}'`" curdir=$PWD #### OPTIONS #### host_name="OpenRig" Drivers="16.40" #Drivers="17.50" #Drivers="18.20" #Drivers="18.40" #Drivers="18.50" #ubuntu 18.04 #Drivers="19.30" #ubuntu 18.04 ROCM_="NO" #rcom compute ETHMine="YES" XMRIG_AMD="YES" XMR_STAK="YES" SGMINER="YES" SGMINER_TT="YES" SGMINER_x16r="YES" Lyra2z="NO" Phoenix="YES" lolMiner="YES" Gminer="YES" swap_size="16" # 0/4/8/16 Go NewNiceHash="YES" Pro="YES" #script_version=`grep version version.txt | awk '{ print $2 }'` #rdate=`grep release version.txt | awk '{ print $2 }'` #if [[ $lsb_v = "18.04" || $lsb_v = "18.10" ]]; then Drivers="18.50" && Lyra2z="NO" && ROCM_="NO" ;fi if [ $Drivers = "16.40" ]; then amd_driver_v="16.40-348864" && ROCM_="NO" ;fi if [ $Drivers = "17.50" ]; then amd_driver_v="17.50-511655" && ROCM_="NO" ;fi if [ $Drivers = "18.20" ]; then amd_driver_v="18.20-606296" && Lyra2z="NO" && ROCM_="NO" ;fi if [ $Drivers = "18.40" ]; then amd_driver_v="18.40-673869" && Lyra2z="NO" && ROCM_="NO" ;fi if [ $Drivers = "18.50" ]; then amd_driver_v="18.50-708488" && Lyra2z="NO" && ROCM_="NO" ;fi if [ $Drivers = "19.30" ]; then amd_driver_v="19.30-855429" && Lyra2z="NO" && ROCM_="NO" ;fi 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 claymore_dual_v="`curl -s $remote_folder/version.txt | awk 'NR==1 {print$3; exit}'`" claymore_zcash_v="`curl -s $remote_folder/version.txt | awk 'NR==2 {print$3; exit}'`" claymore_xmr_v="`curl -s $remote_folder/version.txt | awk 'NR==3 {print$3; exit}'`" lolminer_v="`curl -s $remote_folder/version.txt | awk 'NR==6 {print$3; exit}'`" Phoenix_v="`curl -s $remote_folder/version.txt | awk 'NR==7 {print$3; exit}'`" Gminer_v="`curl -s $remote_folder/version.txt | awk 'NR==8 {print$3; exit}'`" 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 Mining Rig 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 if [ $lsb_v = "18.04" ]; then echo -e "\e[97m Ubuntu 18.04 \e[0m\e[97m";fi if [ $lsb_v = "18.10" ]; then echo -e "\e[97m Ubuntu 18.10 \e[0m\e[97m";fi if [ $ROCM_ = "YES" ]; then echo -e "\e[94m AMD DRIVER + ROCm Compute firmware \e[0m\e[97m";fi if [ $ROCM_ = "NO" ]; then echo -e "\e[94m AMD GPU PRO Drivers $amd_driver_v\e[0m\e[97m";fi echo -e "" if [ $NewNiceHash = "YES" ]; then echo -e "\e[97m +\e[92m New NicheHash\e[0m\e[93m";fi if [ $ETHMine = "YES" ]; then echo -e "\e[97m +\e[91m Etherminer \e[0m\e[97m";fi if [ $XMRIG_AMD = "YES" ]; then echo -e "\e[97m +\e[91m XMRig-amd \e[0m\e[97m";fi if [ $XMR_STAK = "YES" ]; then echo -e "\e[97m +\e[91m XMR-Stak \e[0m\e[97m";fi if [ $lolMiner = "YES" ]; then echo -e "\e[97m +\e[91m lolMiner v$lolminer_v\e[0m\e[97m";fi if [ $SGMINER = "YES" ]; then echo -e "\e[97m +\e[91m Sgminer-nicehash\e[0m\e[97m";fi if [ $SGMINER_TT = "YES" ]; then echo -e "\e[97m +\e[91m Sgminer-timetravel\e[0m\e[97m";fi if [ $SGMINER_x16r = "YES" ]; then echo -e "\e[97m +\e[91m Sgminer-x16r\e[0m\e[97m";fi echo -e "\e[97m +\e[91m Claymore dualminer $claymore_dual_v\e[0m\e[97m" echo -e "\e[97m +\e[91m Claymore zcash $claymore_zcash_v\e[0m\e[97m" echo -e "\e[97m +\e[91m Claymore xmr $claymore_xmr_v\e[0m\e[97m" if [ $Lyra2z = "YES" ]; then echo -e "\e[97m +\e[91m Lyra2z GPU Mining (experimental)\e[0m\e[97m";fi if [ $Phoenix = "YES" ]; then echo -e "\e[97m +\e[91m Phoenix ETH v$Phoenix_v \e[0m\e[97m";fi if [ $Gminer = "YES" ]; then echo -e "\e[97m +\e[91m Gminer v$Gminer_v \e[0m\e[97m";fi echo sleep 4 sed -i -e "s/# set const/set const/g" /etc/nanorc echo -e "\n\e[95mExpand Disk :\e[0m" sudo growpart `df -h | grep /dev/sd | awk ' { print $1 }'| cut -c -8` 1 |true sudo resize2fs `df -h | grep /dev/sd | awk ' { print $1 }'` |true echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mSystem Update :\e[0m" sudo apt-get update && echo "" sudo add-apt-repository -y ppa:ethereum/ethereum -y && echo "" sudo apt-get update && echo "" cd ~ sudo sed -i -e "s/quiet splash/text/g" /etc/default/grub sudo sed -i -e 's#GRUB_CMDLINE_LINUX=""#GRUB_CMDLINE_LINUX="amddgpu.vm_fragment_size=9"#g' /etc/default/grub sudo update-grub2 && echo "" sudo apt dist-upgrade -y && echo "" if ! [[ $lsb_v = "18.04" || $lsb_v = "18.10" ]];then sudo apt-get remove linux-image-4.4.0-116* linux-headers-4.4.0-116* -y ;fi sudo apt install ethereum git screen htop curl ntp pv git cmake libleveldb-dev libjsoncpp-dev \ build-essential libcurl4-gnutls-dev libboost-all-dev libgmp-dev \ libreadline-dev libmicrohttpd-dev libjansson-dev libgmp-dev libssl-dev unzip python-nfqueue python-scapy mesa-common-dev -y && echo "" if ! [[ $lsb_v = "18.04" || $lsb_v = "18.10" ]];then sudo apt install libcryptopp-dev -y ;fi && echo"" if ! [[ $lsb_v = "18.04" || $lsb_v = "18.10" ]];then sudo apt-get install --install-recommends xserver-xorg-hwe-16.04 -y; fi && echo "" if [ $ROCM_ = "YES" ] then sudo apt-get install libnuma-dev -y echo -e "\n\e[95mInstall ROCm Compute:\e[0m" #update ROCM sudo apt-get install libnuma-dev -y wget -qO - http://repo.radeon.com/rocm/apt/debian/rocm.gpg.key | sudo apt-key add - sudo sh -c 'echo deb [arch=amd64] http://repo.radeon.com/rocm/apt/debian/ xenial main > /etc/apt/sources.list.d/rocm.list' sudo apt-get update sudo apt-get install rocm-opencl-dev -y sudo usermod -a -G video work cd .. echo -e "\e[97mDone !\e[0m" fi echo -e "\n\e[95mInstall AMD Drivers :\e[0m" if ! [ -d /home/work/tempo ];then mkdir /home/work/tempo ; fi cd /home/work/tempo if [ $Drivers = "16.40" ] then wget -c http://wareck.free.fr/grinder/drivers/amdgpu-pro-16.40-348864.tar.xz tar xvfJ amdgpu-pro-16.40-348864.tar.xz rm amdgpu-pro-16.40-348864.tar.xz cd amdgpu-pro-16.40-348864 if [ $ROCM_ = "YES" ] then sed -i -e "s/amdgpu-pro-dkms libdrm2-amdgpu-pro/libdrm2-amdgpu-pro/g" amdgpu-pro-install ./amdgpu-pro-install --px -y else ./amdgpu-pro-install --px -y fi fi if [ $Drivers = "17.50" ] then wget -c http://wareck.free.fr/grinder/drivers/amdgpu-pro-17.50-511655.tar.xz tar xvfJ amdgpu-pro-17.50-511655.tar.xz rm amdgpu-pro-17.50-511655.tar.xz cd amdgpu-pro-17.50-511655 if [ $ROCM_ = "YES" ] then sed -i -e "s/amdgpu-pro-dkms libdrm2-amdgpu-pro/libdrm2-amdgpu-pro/g" amdgpu-pro-install ./amdgpu-pro-install --pro --opencl=legacy,rocm -y else if [ $Pro = "YES" ] then ./amdgpu-pro-install --pro --opencl=legacy -y else ./amdgpu-install --opencl=legacy -y fi fi fi if [ $Drivers = "18.20" ] then echo "Download amdgpu-pro-18.20-606296.tar.xz" wget -c http://wareck.free.fr/grinder/drivers/amdgpu-pro-18.20-606296.tar.xz tar xvfJ amdgpu-pro-18.20-606296.tar.xz rm amdgpu-pro-18.20-606296.tar.xz cd amdgpu-pro-18.20-606296 if [ $ROCM_ = "YES" ] then sed -i -e "s/amdgpu-pro-dkms libdrm2-amdgpu-pro/libdrm2-amdgpu-pro/g" amdgpu-pro-install ./amdgpu-pro-install --pro --opencl=legacy,rocm -y else if [ $Pro = "YES" ] then ./amdgpu-pro-install --pro --opencl=legacy -y else ./amdgpu-install --opencl=legacy -y fi fi fi if [ $Drivers = "18.40" ] then echo "Download amdgpu-pro-18.40-673869-ubuntu-16.04.tar.xz" wget -c http://wareck.free.fr/grinder/drivers/amdgpu-pro-18.40-673869-ubuntu-16.04.tar.xz tar xvfJ amdgpu-pro-18.40-673869-ubuntu-16.04.tar.xz rm amdgpu-pro-18.40-673869-ubuntu-16.04.tar.xz cd amdgpu-pro-18.40-673869-ubuntu-16.04 ./amdgpu-pro-install --pro --opencl=legacy -y fi if [ $Drivers = "18.50" ] then echo "Download amdgpu-pro-18.40-673869-ubuntu-16.04.tar.xz" wget -c http://wareck.free.fr/grinder/drivers/amdgpu-pro-18.50-708488-ubuntu-18.04.tar.xz tar xvfJ amdgpu-pro-18.50-708488-ubuntu-18.04.tar.xz rm amdgpu-pro-18.50-708488-ubuntu-18.04.tar.xz cd amdgpu-pro-18.50-708488-ubuntu-18.04 ./amdgpu-pro-install --pro --opencl=legacy -y fi if [ $Drivers = "19.30" ] then echo "Download amdgpu-pro-19.30-855429-ubuntu-18.04.tar.xz" wget -c http://wareck.free.fr/grinder/drivers/amdgpu-pro-19.30-855429-ubuntu-18.04.tar.xz tar xvfJ amdgpu-pro-19.30-855429-ubuntu-18.04.tar.xz rm amdgpu-pro-19.30-855429-ubuntu-18.04.tar.xz cd amdgpu-pro-19.30-855429-ubuntu-18.04 ./amdgpu-pro-install --pro --opencl=legacy -y fi echo -e "\n\e[95mInstall AMD SDK :\e[0m" cd /home/work/tempo/ curl -f http://wareck.free.fr/grinder/drivers/AMD-APP-SDKInstaller-v3.0.130.136-GA-linux64.tar.bz2 | tar xvj ./AMD-APP-SDK-v3.0.130.136-GA-linux64.sh cd /opt/ if [ -d ADL_SDK ]; then rm -r /opt/ADL_SDK; fi mkdir ADL_SDK cd ADL_SDK wget -c http://wareck.free.fr/grinder/drivers/ADL_SDK102.zip -O ADL_SDK.zip unzip -q ADL_SDK.zip cd ~ echo -e "\e[97mDone !\e[0m" sleep 2 echo -e "\n\e[95mInstall Claymore Dualminer :\e[0m" cd /home/work/ sudo -u work curl -sf $remote_folder/miners/claymore_dual_$claymore_dual_v.tar.xz | tar xvJ echo -e "\n\e[95mInstall Claymore Zcash miner:\e[0m" sudo -u work curl -sf $remote_folder/miners/claymore_zcash_$claymore_zcash_v.tar.xz | tar xvJ echo -e "\n\e[95mInstall Claymore Xmr miner:\e[0m" sudo -u work curl -sf $remote_folder/miners/claymore_xmr_$claymore_xmr_v.tar.xz | tar xvJ echo "" if [ $NewNiceHash = "YES" ] then echo -e "\n\e[95mInstall miner.sh (NewNiceHash) :\e[0m" cp -v $curdir/miner_new.sh /home/work/miner.sh else echo -e "\n\e[95mInstall miner.sh :\e[0m" cp -v $curdir/miner.sh /home/work/miner.sh fi sudo chown work claymore sudo chown work claymore_xmr sudo chown work claymore_zcash sudo chown work /home/work/miner.sh if [ $Phoenix = "YES" ] then echo -e "\n\e[95mInstall Phoenix v$Phoenix_v :\e[0m" sudo -u work curl -sf $remote_folder/miners/PhoenixMiner_v$Phoenix_v.tar.xz | tar xvJ sudo chown -R work /home/work/PhoenixMiner fi if [ $lolMiner = "YES" ] then echo -e "\n\e[95mInstall lolMiner v$lolminer_v :\e[0m" sudo -u work curl -sf $remote_folder/miners/lolMiner_v$lolminer_v.tar.xz | tar xvJ sudo chown -R work /home/work/lolMiner fi if [ $Gminer = "YES" ] then echo -e "\n\e[95mInstall Gminer v$Gminer_v :\e[0m" sudo -u work curl -sf $remote_folder/miners/gminer_v$Gminer_v.tar.xz | tar xvJ sudo chown -R work /home/work/gminer fi if [ $ETHMine = "YES" ] then echo -e "\n\e[95mInstall Ethminer :\e[0m" cd ~ if [ -d cpp_ethminer ] ; then rm -r cpp_ethminer ;fi git clone -n https://github.com/ethereum-mining/ethminer.git cpp_ethminer cd cpp_ethminer git checkout 2200dca33d35273fb2a7843a7d313a9a31bcd246 cd ~/cpp_ethminer git submodule update --init --recursive mkdir build |true cd build cmake .. -DETHASHCUDA=OFF -DETHASHCL=ON make cd ~ if [ -f ~/ethminer ]; then rm ~/ethminer ;fi ln -s cpp_ethminer/build/ethminer/ethminer ethminer cd /tmp wget http://wareck.free.fr/grinder/cpp_ethminer_kernel.tar.xz tar xvfJ cpp_ethminer_kernel.tar.xz sudo mv kernels ~/cpp_ethminer/build/ethminer/ cd ~ echo -e "\e[97mDone !\e[0m" fi if [ $SGMINER = "YES" ] then echo -e "\n\e[95mInstall Sgminer-Nicehash:\e[0m" cd ~ if [ ! -d sgminer ] then git clone https://github.com/nicehash/sgminer.git cd sgminer else cd sgminer git pull fi sudo apt install git autoconf automake libtool build-essential libncurses5-dev libcurl4-gnutls-dev -y git submodule init git submodule update autoreconf -fi CFLAGS="-Os -Wall -march=native -I/opt/AMDAPPSDK-3.0/include" LDFLAGS="-L/opt/amdgpu-pro/lib/x86_64-linux-gnu" ./configure --disable-git-version --disable-adl make -j $(nproc) cd ~ echo -e "\e[97mDone !\e[0m" fi if [ $SGMINER_TT = "YES" ] then echo -e "\n\e[95mInstall Sgminer-Timetravel:\e[0m" cd ~ if [ ! -d sgminer-timetravel ] then sudo -u work curl -sf http://wareck.free.fr/openrig/miners/sgminer-timetravel.tar.xz | tar xvJ cd ~ fi echo -e "\e[97mDone !\e[0m" fi if [ $Lyra2z = "YES" ] then echo -e "\n\e[95mInstall Lyra2Z GPU Miner (experimental):\e[0m" cd ~ if [ -d sgminer-lyra2z ]; then rm -r sgminer-lyra2z ;fi git clone https://github.com/wareck/sgminer-lyra2z.git cd ~/sgminer-lyra2z git pull git submodule init git submodule update ./autogen.sh CFLAGS="-Os -Wall -march=native -I/opt/AMDAPPSDK-3.0/include" LDFLAGS="-L/opt/amdgpu-pro/lib/x86_64-linux-gnu" ./configure --disable-git-version --disable-adl make -j $(nproc) cd ~ echo "Done." fi if [ $SGMINER_x16r = "YES" ] then echo -e "\n\e[95mInstall Sgminer-x16r :\e[0m" cd ~ if [ -d sgminer-x16r ]; then rm -r sgminer-x16r;fi git clone https://github.com/wareck/sgminer-x16r.git cd ~/sgminer-x16r git pull git submodule init git submodule update ./autogen.sh CFLAGS="-Os -Wall -march=native -I/opt/AMDAPPSDK-3.0/include" LDFLAGS="-L/opt/amdgpu-pro/lib/x86_64-linux-gnu" ./configure --disable-git-version --disable-adl make -j $(nproc) cd ~ echo "Done." fi if [ $XMRIG_AMD = "YES" ] then echo -e "\n\e[95mInstall xmrig-amd:\e[0m" cd ~ if [ -d xmrig_amd ]; then rm -r xmrig_amd ; fi git clone https://github.com/xmrig/xmrig-amd.git xmrig_amd 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_amd 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/sysctl.d/60-hugepages.conf sudo sysctl --system fi if ! [ -f /etc/security/limits.d/60-memlock.conf ] then sudo echo "* - memlock 262144" >/etc/security/limits.d/60-memlock.conf sudo echo "root - memlock 262144" >>/etc/security/limits.d/60-memlock.conf fi echo "Done" fi echo -e "\n\e[95mDownloading NoFees Patch:\e[0m" cd ~ if [ -d remove_miner_fees ] then cd remove_miner_fees git pull else git clone https://github.com/wareck/remove_miner_fees.git chown -R work remove_miner_fees fi if ! [ -f /etc/rc.local ] then printf '%s\n' '#!/bin/bash' 'exit 0' | sudo tee -a /etc/rc.local sudo chmod +x /etc/rc.local fi chmod 777 /etc/rc.local if ! grep --quiet "/home/work/remove_miner_fees" /etc/rc.local then sed -i "s/exit 0//g" /etc/rc.local RC_LOCAL_CMD0="#python /home/work/remove_miner_fees/remove_mining_fees.py &" RC_LOCAL_CMD1="#python /home/work/remove_miner_fees/zcach.py &" RC_LOCAL_CMD2="#python /home/work/remove_miner_fees/hush.py &" RC_LOCAL_CMD3="#python /home/work/remove_miner_fees/ubiq.py &" RC_LOCAL_CMD4="#python /home/work/remove_miner_fees/soilcoin.py &" echo $RC_LOCAL_CMD0 >>/etc/rc.local echo $RC_LOCAL_CMD1 >>/etc/rc.local echo $RC_LOCAL_CMD2 >>/etc/rc.local echo $RC_LOCAL_CMD3 >>/etc/rc.local echo $RC_LOCAL_CMD4 >>/etc/rc.local echo "exit 0" >>/etc/rc.local fi echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mInstall AutoStart:\e[0m" if [ -f /home/work/.config/autostart/miner.sh.desktop ];then rm /home/work/.config/autostart/miner.sh.desktop |true ; fi if ! [ -d /home/work/.config ]; then mkdir /home/work/.config ;fi if ! [ -d /home/work/.config/autostart ]; then mkdir /home/work/.config/autostart;fi cat <> /home/work/.config/autostart/miner.sh.desktop [Desktop Entry] Type=Application Exec=/home/work/miner.sh Hidden=false NoDisplay=false X-GNOME-Autostart-enabled=true Name[fr_FR]=miner Name=miner Comment[fr_FR]=miner Comment=miner EOF sleep 5 chmod 777 /etc/rc.local if ! grep --quiet "su work -c '/home/work/miner.sh'" /etc/rc.local then sed -i "s/exit 0//g" /etc/rc.local RC_LOCAL_CMD0="su work -c '/home/work/miner.sh'" echo $RC_LOCAL_CMD0 >>/etc/rc.local echo "exit 0" >>/etc/rc.local fi echo -e "\e[97mDone !\e[0m" cd /home/work/ sudo rm -r tempo echo -e "\n\e[95mMessage of the day mod :\e[0m" rm /etc/update-motd.d/00-header | true rm /etc/update-motd.d/10-help-text |true rm /etc/update-motd.d/90-updates-available |true rm /etc/update-motd.d/91-release-upgrade |true rm /etc/update-motd.d/98-fsck-at-reboot |true rm /etc/update-motd.d/98-reboot-required |true echo " - 00-header " cat <> /etc/update-motd.d/00-header #!/bin/sh [ -r /etc/lsb-release ] && . /etc/lsb-release if [ -z "$DISTRIB_DESCRIPTION" ] && [ -x /usr/bin/lsb_release ]; then # Fall back to using the very slow lsb_release utility DISTRIB_DESCRIPTION=$(lsb_release -s -d) fi printf "Welcome to %s (%s %s %s)\n" "$DISTRIB_DESCRIPTION" " $(uname -o)" "$(uname -p)" EOF cd /etc/update-motd.d sudo -u work curl -sf http://folivier.homelinux.org/genethos/files/motd.tar.xz | tar xJ cd ~ sed -i -e "s/#force_color_prompt=yes/force_color_prompt=yes/g" /home/work/.bashrc if ! grep --quiet "export DISPLAY=:0" /home/work/.bashrc then cat <> /home/work/.bashrc export DISPLAY=:0 echo -e "\e[97m Open Mining Platform \e[96mv$script_version\e[0m wareck@gmail.com " EOF fi echo -e "\e[97mDone !\e[0m" echo -e "\n\e[95mBuilding Swapfile :\e[0m" if ! grep -q "swapfile" /etc/fstab ; then case $swap_size in 0) fst="0";; 4) sudo dd if=/dev/zero | pv -s 4G | dd of=/swapfile iflag=fullblock bs=1024 count=4194304;; 8) sudo dd if=/dev/zero | pv -s 8G | dd of=/swapfile iflag=fullblock bs=1024 count=8388608;; 16) sudo dd if=/dev/zero | pv -s 16G | dd of=/swapfile iflag=fullblock bs=1024 count=16777216 ;; *) echo -e "\e[91mError in configuration !\e[0m" && exit ;; esac if ! [ $swap_size = "0" ] then sudo mkswap /swapfile sudo swapon /swapfile sudo cat <<'EOF'>> /etc/fstab /swapfile none swap sw 0 0 EOF sudo chmod 600 /swapfile sudo touch /forcefsck fi else echo -e "\e[93mSwapfile already enabled... \e[0m" echo -e "\e[93mCheck /etc/fsatb file.\e[0m\n" fi echo -e "\e[97mDone !\e[0m" sudo usermod -a -G video work echo -e "\n\e[95mConfigure Hostname and Rig name:\e[0m" touch /tmp/hostname echo $host_name >/tmp/hostname sudo bash -c 'cp /tmp/hostname /etc/hostname' sed -i -e "s/digger/$host_name/g" /etc/hosts # rename rig in miner.sh sed -i -e "s/OpenRig/$host_name/g" miner.sh # nano count lines sed -i -e "s/# set const/set const/g" /etc/nanorc # reset ssh keys rm /etc/ssh/ssh_host_* dpkg-reconfigure openssh-server sudo apt-get autoremove -y echo "Done" echo -e "\n\e[92mEverything was done...\e[0m" echo -e -n "Reboot in 15 seconds (CRTL+C to abord): " for i in {15..1} do echo -e -n "$i " sleep 1 done sudo reboot