-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall
executable file
·178 lines (125 loc) · 4.64 KB
/
install
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#!/bin/bash
##############################################################################################
sudo mkdir -p /crypto/miners
sudo chown -R $USER:$USER /crypto
sudo touch /var/log/mining.log
sudo chown syslog:adm /var/log/mining.log
##############################################################################################
echo "installing packages"
sudo apt-get install -f ssh zsh tree screen vim net-tools bmon ifupdown checksecurity logcheck at-spi2-core \
build-essential gcc-5 g++-5 cmake pkg-config libtool automake autoconf autogen \
jq curl git mailutils xterm ntpdate \
nvidia-cuda-dev nvidia-cuda-toolkit xorg xserver-xorg-legacy xserver-xorg-video-dummy libcurl4-openssl-dev libssl-dev libjansson-dev autotools-dev uthash-dev libevent-dev libncurses5-dev libncursesw5-dev libbase58-dev libblkmaker-0.1-dev libhidapi-dev libusb-1.0-0-dev libmicrohttpd-dev libudev-dev libscrypt-dev yasm
##############################################################################################
echo "intalling miners"
if [ ! -f "/crypto/miners/0.3.4b/miner" ]; then
echo "installing ewfb miner"
mkdir -p /crypto/miners/0.3.4b
cd /crypto/miners/0.3.4b
wget https://github.com/nanopool/ewbf-miner/releases/download/v0.3.4b/Zec.miner.0.3.4b.Linux.Bin.tar.gz > /dev/null
tar zxvf Zec.miner.0.3.4b.Linux.Bin.tar.gz > /dev/null
rm Zec.miner.0.3.4b.Linux.Bin.tar.gz
cd /crypto/miners
fi
if [ ! -d "/crypto/miners/ccminer" ]; then
echo "cloning ccminer"
git clone https://github.com/tpruvot/ccminer.git
else
echo "updating ccminer"
cd /crypto/miners/ccminer && git pull
fi
if [ ! -f "/crypto/miners/ccminer/ccminer" ]; then
echo "compiling ccminer, be patient"
cd /crypto/miners/ccminer && ./build.sh &> /dev/null
fi
if [ ! -d "/crypto/miners/bfgminer" ]; then
echo "cloning bfgminer"
cd /crypto/miners/
git clone https://github.com/luke-jr/bfgminer.git
else
echo "updating bfgminer"
cd /crypto/miners/bfgminer && git pull
fi
if [ ! -f "/crypto/miners/bfgminer/bfgminer" ]; then
cd /crypto/miners/bfgminer
echo "configuring bfgminer"
./autogen.sh
./configure --enable-scrypt --enable-cpumining
echo "compiling bfgminer, be patient"
make &> /dev/null
fi
# nsgminer
if [ ! -d "/crypto/miners/nsgminer" ]; then
echo "cloning nsgminer"
cd /crypto/miners/
git clone https://github.com/ghostlander/nsgminer.git
else
echo "updating nsgminer"
cd /crypto/miners/nsgminer && git pull
fi
if [ ! -f "/crypto/miners/nsgminer/nsgminer" ]; then
echo "configuring nsgminer"
cd /crypto/miners/nsgminer
./autogen.sh &> /dev/null
./configure --enable-scrypt --enable-cpumining --enable-bitforce --enable-icarus &> /dev/null &> /dev/null
echo "compiling nsgminer, be patient"
make &> /dev/null
fi
# sgminer
if [ ! -d "/crypto/miners/sgminer-x17" ]; then
echo "sgminer-x17"
cd /crypto/miners/
git clone https://github.com/LordzS/sgminer-x17.git
else
echo "updating sgminer-x17"
cd /crypto/miners/sgminer-x17 && git pull
fi
if [ ! -f "/crypto/miners/sgminer-x17/sgminer" ]; then
echo "configuring sgminer-x17"
cd /crypto/miners/sgminer-x17
sh ./autogen.sh &> /dev/null
./configure &> /dev/null
echo "compiling sgminer-x17, be patient"
make &> /dev/null
fi
if [ ! -d "/crypto/miners/zm_0.6" ]; then
echo "DSTM ZCash"
cd /crypto/miners/
tar zxvf /crypto/tools/miners/zm_0.6.tar.gz > /dev/null
fi
#apt-get install bfgminer
if [ ! -f "/etc/X11/xorg.conf" ]; then
echo "configuring X"
sudo nvidia-xconfig --allow-empty-initial-configuration --enable-all-gpus --cool-bits=31 --separate-x-screens
echo "manual" | sudo tee -a /etc/init/lightdm.override
sudo systemctl disable lightdm.service
fi
# config
BASH_MODIF=$(grep mining.aliases ~/.bashrc | wc -l)
if [ "$BASH_MODIF" = "0" ]; then
echo "modifying ~/.bashrc"
echo "source /crypto/tools/home/mining.aliases" >> ~/.bashrc
source ~/.bashrc
fi
CRONTAB_MODIF=$(grep mcheck-service /etc/crontab | wc -l)
if [ "$CRONTAB_MODIF" = "0" ]; then
echo "modifying /etc/crontab"
echo "*/2 * * * * root /crypto/tools/mcheck-service >/dev/null 2>&" | sudo tee --append /etc/crontab > /dev/null
fi
if [ ! -f "/etc/mining.conf" ]; then
sudo cp /crypto/tools/etc/mining.conf /etc/mining.conf
fi
if [ ! -f "/etc/logrotate.d/mining" ]; then
sudo cp /crypto/tools/etc/logrotate.d/mining /etc/logrotate.d/mining
fi
if [ ! -f "/etc/systemd/system/mining.service" ]; then
echo "Placing mining daemon"
sudo cp /crypto/tools/etc/systemd/system/mining.service /etc/systemd/system/mining.service
sudo systemctl enable mining
fi
if [ ! -f "/etc/update-motd.d/99-mining" ]; then
echo "Placing mining motd"
sudo cp /crypto/tools/etc/update-motd.d/99-mining /etc/update-motd.d/99-mining
fi
# grub
# edit config !