forked from WantClue/Pisces-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtroubleshoot.sh
179 lines (147 loc) · 4.35 KB
/
troubleshoot.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
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
177
178
179
#!/bin/bash
function isRoot() {
if [ "${EUID}" -ne 0 ]; then
echo "Hai bisogno dei permessi root per eseguire questo script! Esegui prima un 'sudo su'"
exit 1
fi
}
function initialQuestions() {
echo " Bene! Possiamo iniziare con l'ottimizzazione del tuo Pisces!"
echo ""
echo ""
echo ""
echo ""
read -n1 -r -p "Premi qualsiasi tasto per continuare..."
}
function manageMenu() {
echo "Cosa vorresti fare?"
echo " 1) Cancellare tutti i dati della Blockchain ed eseguire immediatamente un fastsyc"
echo " 2) Fix PacketForwarder Issue"
echo " 3) Fix Dashboard not loading"
echo " 4) Get a new Snapshot"
echo " 5) Risolvi i problemi dei Not Found ERROR (Aumenta i Peerbook)"
echo " 6) Exit"
until [[ ${MENU_OPTION} =~ ^[1-6]$ ]]; do
read -rp "Select an option [1-6]: " MENU_OPTION
done
case "${MENU_OPTION}" in
1)
clearBlockchain
;;
2)
packetForwarder
;;
3)
nginx
;;
4)
newSnapshot
;;
5)
peerBookIncrease
;;
6)
#Check for full Disk
df -h
echo "If your Disk Usage is below 100% you´re good to go!"
echo ""
echo "You can ignore most of the error Logs of Dashboard"
echo "Just leave the device online"
echo "If not run this script again and choose: Clear Blockchain Data and resync"
exit 0
;;
esac
}
function clearBlockchain() {
echo "Usiamo lo script del Fastsync di inigoflores!"
local PS3='Please enter sub option: '
local options=("Install automation" "Clear Blockchain once" "Sub menu quit")
local opt
select opt in "${options[@]}"
do
case $opt in
"Install automation")
wget https://raw.githubusercontent.com/moophlo/pisces-miner-scripts/main/crontab_job.sh -O - | sudo bash
return
;;
"Clear Blockchain once")
wget https://raw.githubusercontent.com/moophlo/pisces-miner-scripts/main/clear_resync.sh -O - | sudo bash
return
;;
"Sub menu quit")
return
;;
*) echo "invalid option $REPLY";;
esac
done
}
function packetForwarder() {
echo "By using this fix you will change some files in your Hotspot"
echo "If you´re sure what you´re doing go ahead an choos an option"
echo "This script uses the Pkt Fwd Fix of inigoflores!"
echo ""
local PS3='Please enter sub option: '
local options=("Fix issue" "Sub menu quit")
local opt
select opt in "${options[@]}"
do
case $opt in
"Fix issue")
sudo wget https://raw.githubusercontent.com/inigoflores/pisces-p100-tools/main/Packet_Forwarder_V2/update.sh -O - | sudo bash
return
;;
"Sub menu quit")
return
;;
*) echo "invalid option $REPLY";;
esac
done
}
function nginx() {
echo ""
echo "Did you got the Dashboard error message:"
echo "Bad Gateway Error 400 ?"
echo " 1) Yes"
echo " 2) No"
until [[ ${MENU_OPTION} =~ ^[1-2]$ ]]; do
read -rp "Select an option [1-2]: " MENU_OPTION
done
case "${MENU_OPTION}" in
1)
echo "open the Dashboard with https://yourmineripadress"
;;
2)
echo "You´re good nothing is wrong!"
exit 0
;;
esac
}
function newSnapshot() {
wget https://raw.githubusercontent.com/moophlo/pisces-miner-scripts/main/clear_resync.sh -O - | sudo bash
}
function peerBookIncrease() {
echo "Do you really want to change the Peerbook settings?"
echo "This is testing only!!!"
echo ""
echo "You need to type in >>sudo docker exec miner miner peer book -c<< to see the increasement"
echo ""
echo " 1) Yes"
echo " 2) No"
echo " 3) Restore backup of sys.config"
until [[ ${MENU_OPTION} =~ ^[1-2]$ ]]; do
read -rp "Select an option [1-2]: " MENU_OPTION
done
case "${MENU_OPTION}" in
1)
wget https://raw.githubusercontent.com/WantClue/Pisces-scripts/main/peerbook_fix.sh -O - | sudo bash
;;
2)
exit 0
;;
3)
echo "currently no backup you need to do this manually"
;;
esac
}
initialQuestions
manageMenu