|
@@ -1,6 +1,7 @@
|
|
|
#!/bin/bash
|
|
|
set -e
|
|
|
-Version=2.0
|
|
|
+Version=2.2
|
|
|
+Gui=no #YES for gui build
|
|
|
function print_centered {
|
|
|
[[ $# == 0 ]] && return 1
|
|
|
|
|
@@ -32,6 +33,11 @@ print_centered "| ---| || || _ |"
|
|
|
print_centered "|______|__|__||__||___._|"
|
|
|
echo -n "$(tput setaf 7)"
|
|
|
print_centered "Toolkit for Chia v$Version"
|
|
|
+if [ $Gui = "YES" ]
|
|
|
+then
|
|
|
+echo -n "$(tput setaf 7)"
|
|
|
+print_centered "(Gui / wallet enabled)"
|
|
|
+fi
|
|
|
print_centered "$(tput setaf 7)"
|
|
|
sleep 3
|
|
|
echo -e "$(tput setaf 2)\nUpdate and install packages:$(tput sgr0)"
|
|
@@ -41,20 +47,38 @@ echo -e "\e[97mDone.\e[0m"
|
|
|
echo -e "$(tput setaf 2)\nDownload pack:$(tput sgr0)"
|
|
|
./download_pack.sh
|
|
|
|
|
|
-
|
|
|
echo -e "$(tput setaf 2)\nBuild Chia-Miner:$(tput sgr0)"
|
|
|
cp ../pack/chia-miner.tar.xz /home/wareck/
|
|
|
cd /home/wareck
|
|
|
tar xvfJ chia-miner.tar.xz
|
|
|
rm chia-miner.tar.xz
|
|
|
-sudo cp chia-miner/chia-miner /etc/init.d/
|
|
|
+cat <<'EOF'>> chia-miner.sh
|
|
|
+#!/bin/sh -e
|
|
|
+### BEGIN INIT INFO
|
|
|
+# Provides: chiaminer
|
|
|
+# Required-Start: networking
|
|
|
+# Default-Start: 3 4 5
|
|
|
+# Default-Stop: 0 6
|
|
|
+### END INIT INFO
|
|
|
+cd /home/wareck/chia-miner/
|
|
|
+su wareck -c "screen -dmS chia-miner /home/wareck/chia-miner/hpool-miner-chia -config /home/wareck/chia-miner/config.yaml"
|
|
|
+exit 0
|
|
|
+EOF
|
|
|
+chmod +x chia-miner.sh
|
|
|
+sudo cp chia-miner.sh /etc/init.d/chia-miner
|
|
|
sudo update-rc.d chia-miner defaults
|
|
|
-sudo rm /home/wareck/chia-miner/chia-miner
|
|
|
+sudo rm chia-miner.sh
|
|
|
echo -e "\e[97mDone.\e[0m"
|
|
|
|
|
|
echo -e "$(tput setaf 2)\nBuild Chia-Plotter (MadMax) :$(tput sgr0)"
|
|
|
cd /home/wareck
|
|
|
+if [ ! -d chia-plotter ]
|
|
|
+then
|
|
|
git clone https://github.com/madMAx43v3r/chia-plotter.git
|
|
|
+else
|
|
|
+cd /home/wareck/chia-plotter
|
|
|
+git pull
|
|
|
+fi
|
|
|
cd /home/wareck/chia-plotter
|
|
|
git submodule init
|
|
|
git submodule update
|
|
@@ -75,20 +99,35 @@ echo -e "\e[97mDone.\e[0m"
|
|
|
|
|
|
echo -e "$(tput setaf 2)\nBuild Chia-Pos:$(tput sgr0)"
|
|
|
cd /home/wareck/
|
|
|
+if [ ! -d /home/wareck/chia-pos ]
|
|
|
+then
|
|
|
git clone https://github.com/Chia-Network/chiapos.git chia-pos
|
|
|
cd /home/wareck/chia-pos
|
|
|
-mkdir build
|
|
|
+else
|
|
|
+cd /home/wareck/chia-pos
|
|
|
+git pull
|
|
|
+fi
|
|
|
+if [ ! -d build ]; then mkdir build;fi
|
|
|
cd build
|
|
|
cmake ..
|
|
|
make -j4
|
|
|
echo -e "\e[97mDone.\e[0m"
|
|
|
|
|
|
+if [ $Gui = "YES" ]
|
|
|
+then
|
|
|
echo -e "$(tput setaf 2)\nBuild Chia-Gui :$(tput sgr0)"
|
|
|
cd /home/wareck
|
|
|
+if [ ! -d /home/wareck/chia-pos ]
|
|
|
+then
|
|
|
git clone https://github.com/Chia-Network/chia-blockchain.git -b latest --recurse-submodules
|
|
|
cd chia-blockchain
|
|
|
+else
|
|
|
+cd chia-blockchain
|
|
|
+git pull
|
|
|
+fi
|
|
|
sh install.sh
|
|
|
source ./activate
|
|
|
sh install-gui.sh
|
|
|
+fi
|
|
|
|
|
|
echo -e "\n\e[97mEnd of process...\e[0m"
|