-
Notifications
You must be signed in to change notification settings - Fork 13
/
monero_mine_address.sh
executable file
·148 lines (123 loc) · 4.59 KB
/
monero_mine_address.sh
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
#!/bin/bash
#MONERODO Change miner address
#
FILEDIR=$(grep -n 'filedir' /home/bob/monerodo/conf_files/monerodo.index |cut -d"=" -f2)
current_ip="$(ip addr | grep 'state UP' -A2 | tail -n1 | awk '{print $2}' | cut -f1 -d'/')"
clear
#receive new mining address, export to global MOS variable, and store in MOS system folder
rm $FILEDIR/mine_add.txt
echo "Please enter your monero mining address. To skip this type back"
echo "(Reminder: shift+insert is paste if you are using a normal terminal)"
echo "(If you are using the web terminal, right click and hit Paste from Browser"
read mine_add
case "$mine_add" in
back) exit ;;
*)
export mine_add
echo $mine_add > $FILEDIR/mine_add.txt
sudo cp $FILEDIR/mine_add.txt /monerodo/ #again, might be able to keep in home hidden
echo "Do you want to setup an external pool?"
echo "If yes, enter the address. etc: monerohash.com"
echo "If you don't want to set one, just hit enter"
read ext_mine
# write conf file for nvidia miner
mv $FILEDIR/mos_miner.conf $FILEDIR/mos_miner.previous
echo -e "start on started mos_poolnode \n\
stop on stopping mos_poolnode \n\
pre-start exec nvidia-persistenced \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
exec ccminer -o stratum+tcp://$current_ip:5555 -u $mine_add -p x \n\
" > $FILEDIR/mos_miner.conf
# write conf file for nvidia external pool miner
mv $FILEDIR/mos_ext_miner.conf $FILEDIR/mos_ext_miner.previous
echo -e "start on (net-device-up IFACE!=lo) and runlevel [2345] \n\
stop on shutdown \n\
pre-start exec nvidia-persistenced \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
exec ccminer -o stratum+tcp://$ext_mine:5555 -u $mine_add -p x \n\
" > $FILEDIR/mos_ext_miner.conf
mv $FILEDIR/mos_nvidia_solo.conf $FILEDIR/mos_nvidia_solo.previous
echo -e "start on started mos_bitmonero \n\
stop on stopping mos_bitmonero \n\
pre-start exec nvidia-persistenced \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
exec ccminer -o daemon+tcp://$current_ip:18081/json_rpc -u $mine_add -p x \n\
" > $FILEDIR/mos_nvidia_solo.conf
###############################
#write conf files for cpu miner
###############################
cache_size=$(less /proc/cpuinfo | grep -m 1 "cache size" | cut -f 2 | cut -f 2 -d " ")
n=$((cache_size / 2024))
if [ $n == 0 ];
then
n=1
echo "You really shouldn't mine with the CPU on this device. It will really slow down everything"
fi
echo "Press enter to continue"
read whynot
# Write upstart file depending on whether AES is available or not. Uses Wolf's for AES, uses YAM generic for non AES.
# Writes external and internal pool miner
less /proc/cpuinfo > $FILEDIR/cpuinfo.txt
if [ "$(grep aes $FILEDIR/cpuinfo.txt)" ] ;
then
mv $FILEDIR/mos_cpuminer.conf $FILEDIR/mos_cpuminer.previous
echo -e "start on started mos_poolnode \n\
stop on stopping mos_poolnode \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
exec sudo minerd -a cryptonight -o stratum+tcp://$current_ip:3333 -u $mine_add -p x -t $n \n\
" > $FILEDIR/mos_cpuminer.conf
mv $FILEDIR/mos_ext_cpuminer.conf $FILEDIR/mos_ext_cpuminer.previous
echo -e "start on (net-device-up IFACE!=lo) and runlevel [2345] \n\
stop on shutdown \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
exec minerd -a cryptonight -o stratum+tcp://$ext_mine:3333 -u $mine_add -p x -t $n \n\
" > $FILEDIR/mos_ext_cpuminer.conf
mv $FILEDIR/mos_daemonminer.conf $FILEDIR/mos_daemonminer.previous
echo -e "start on bitmonero_sync \n\
stop on stopping mos_bitmonero \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
exec minerd -a cryptonight -o daemon+tcp://$current_ip:18081:/json_rpc -u $mine_add -p x -t $n \n\
" > $FILEDIR/mos_daemonminer.conf
else
mv $FILEDIR/mos_cpuminer.conf $FILEDIR/mos_cpuminer.previous
echo -e "start on started mos_poolnode \n\
stop on stopping mos_poolnode \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
chdir /monerodo/yam/ \n\
exec ./yamgeneric -c x -t $n -M stratum+tcp://$current_ip:x@$mine_add:3333/xmr \n\
" > $FILEDIR/mos_cpuminer.conf
mv $FILEDIR/mos_ext_cpuminer.conf $FILEDIR/mos_ext_cpuminer.previous
echo -e "start on (net-device-up IFACE!=lo) and runlevel [2345] \n\
stop on shutdown \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
chdir /monerodo/yam/ \n\
exec ./yamgeneric -c x -t $n -M stratum+tcp://$ext_mine:x@$mine_add:3333/xmr \n\
" > $FILEDIR/mos_ext_cpuminer.conf
mv $FILEDIR/mos_daemonminer.conf $FILEDIR/mos_daemonminer.previous
echo -e "start on bitmonero_sync \n\
stop on stopping mos_bitmonero \n\
console log \n\
respawn \n\
respawn limit 10 10 \n\
exec minerd -a cryptonight -o daemon+tcp://$current_ip:18081:/json_rpc -u $mine_add -p x -t $n \n\
" > $FILEDIR/mos_daemonminer.conf
fi
clear
;;
esac