-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathUPDATE-MADMAX-PLOTTER.sh
More file actions
99 lines (83 loc) · 3.53 KB
/
UPDATE-MADMAX-PLOTTER.sh
File metadata and controls
99 lines (83 loc) · 3.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#!/bin/bash
# The Chia MadMax Plotter Update Script
# By Rahim Khoja (rahim.khoja@alumni.ubc.ca)
# https://www.linkedin.com/in/rahim-khoja-879944139/
echo
echo -e "\033[0;31m░░░░░░░░▀▀▀██████▄▄▄"
echo "░░░░░░▄▄▄▄▄░░█████████▄ "
echo "░░░░░▀▀▀▀█████▌░▀▐▄░▀▐█ "
echo "░░░▀▀█████▄▄░▀██████▄██ "
echo "░░░▀▄▄▄▄▄░░▀▀█▄▀█════█▀"
echo "░░░░░░░░▀▀▀▄░░▀▀███░▀░░░░░░▄▄"
echo "░░░░░▄███▀▀██▄████████▄░▄▀▀▀██▌"
echo "░░░██▀▄▄▄██▀▄███▀▀▀▀████░░░░░▀█▄"
echo "▄▀▀▀▄██▄▀▀▌█████████████░░░░▌▄▄▀"
echo "▌░░░░▐▀████▐███████████▌"
echo "▀▄░░▄▀░░░▀▀██████████▀"
echo "░░▀▀░░░░░░▀▀█████████▀"
echo "░░░░░░░░▄▄██▀██████▀█"
echo "░░░░░░▄██▀░░░░░▀▀▀░░█"
echo "░░░░░▄█░░░░░░░░░░░░░▐▌"
echo "░▄▄▄▄█▌░░░░░░░░░░░░░░▀█▄▄▄▄▀▀▄"
echo -e "▌░░░░░▐░░░░░░░░░░░░░░░░▀▀▄▄▄▀\033[0m"
echo "---The Chia MadMax Plotter Update Script---"
echo "---By: Rahim Khoja (rahim.khoja@alumni.ubc.ca)---"
echo
# Requirements: Ubuntu 20.04 LTS (Desktop Minimal)
# Internet Access
# NVME Mounted at /mnt/plot
# Previos Install of MadMax Plotter
# Stop on Error
set -eE # same as: `set -o errexit -o errtrace`
# Failure Function
function failure() {
local lineno=$1
local msg=$2
echo ""
echo -e "\033[0;31mError at Line Number $lineno: '$msg'\033[0m"
echo ""
}
# Failure Function Trap
trap 'failure ${LINENO} "$BASH_COMMAND"' ERR
# Check the bash shell script is being run by root/sudo
if [[ $EUID -ne 0 ]];
then
echo "This script must be run with sudo" 1>&2
exit 1
fi
# Create Logging Directory
mkdir -p /var/log/chia-plotter || true
chmod -R 777 /var/log/chia-plotter
# Install Telegram-Send
pip3 install telegram-send
# Remove Old Install
mv /usr/local/bin/madmax-plot.sh /usr/local/bin/madmax-plot.sh.bak || true
rm -f /etc/systemd/system/plotter.service || true
rm -rf /usr/share/chia-plotter || true
rm -f /usr/bin/chia_plot || true
# Install Plotter Service
cp usr/local/bin/madmax-plot.sh /usr/local/bin/
chmod +x /usr/local/bin/madmax-plot.sh
cp etc/systemd/system/plotter.service /etc/systemd/system/
# Setup and Compile MadMax Chia Plotter
cd /usr/share
git clone https://github.com/madMAx43v3r/chia-plotter.git
cd /usr/share/chia-plotter
git submodule update --init
bash ./make_devel.sh
cp /usr/share/chia-plotter/build/chia_plot /usr/bin/
# Reload Systemd Daemons
systemctl daemon-reload
# Enable Plotter Service
systemctl enable plotter.service
num_cpus=$(nproc)
echo
echo "Deployment Successful"
echo
echo "You Have ${num_cpus} Threads Available for Plotting"
echo
echo "Please Edit /usr/local/bin/madmax-plot.sh and Add Your Farmer Key, Your Pool Key, and the Threads to be used by the Plotter"
echo
echo "Please Setup Telegram-Send 'sudo telegram-send --configure'"
echo
echo "Reboot to start Auto Plotting"