-
Notifications
You must be signed in to change notification settings - Fork 0
/
uninstall.sh
executable file
·111 lines (88 loc) · 2.46 KB
/
uninstall.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
#!/bin/bash
function promptYesNo() {
if whiptail --title "Uninstall Staking Node" --defaultno --yesno "This will remove all data and files related to this staking node.\nAre you sure you want to remove all files?\n(consensus/execution/validator/mevboost)" 9 78; then
uninstallCL
uninstallEL
uninstallVC
uninstallMevboost
whiptail --title "Uninstall finished" --msgbox "You have uninstalled this staking node and all validator keys." 8 78
fi
}
function uninstallCL() {
sudo systemctl stop consensus
sudo systemctl disable consensus
sudo rm /etc/systemd/system/consensus.service
#Lighthouse
sudo rm -rf /usr/local/bin/lighthouse
sudo rm -rf /var/lib/lighthouse
#Lodestar
sudo rm -rf /usr/local/bin/lodestar
sudo rm -rf /var/lib/lodestar
#Teku
sudo rm -rf /usr/local/bin/teku
sudo rm -rf /var/lib/teku
#Nimbus
sudo rm -rf /usr/local/bin/nimbus_beacon_node
sudo rm -rf /var/lib/nimbus
sudo userdel consensus
}
function uninstallEL() {
sudo systemctl stop execution
sudo systemctl disable execution
sudo rm /etc/systemd/system/execution.service
#Nethermind
sudo rm -rf /usr/local/bin/nethermind
sudo rm -rf /var/lib/nethermind
#Besu
sudo rm -rf /usr/local/bin/besu
sudo rm -rf /var/lib/besu
#Geth
sudo rm -rf /usr/local/bin/geth
sudo rm -rf /var/lib/geth
#Erigon
sudo rm -rf /usr/local/bin/erigon
sudo rm -rf /var/lib/erigon
#Reth
sudo rm -rf /usr/local/bin/reth
sudo rm -rf /var/lib/reth
sudo userdel execution
}
function uninstallVC() {
sudo systemctl stop validator
sudo systemctl disable validator
sudo rm /etc/systemd/system/validator.service
#Lighthouse
sudo rm -rf /var/lib/lighthouse/validators
#Lodestar
sudo rm -rf /var/lib/lodestar/validators
#Teku, if running Standalone Teku Validator
sudo rm -rf /var/lib/teku_validator
#Nimbus, if running standalone Nimbus Validator
sudo rm -rf /var/lib/nimbus_validator
sudo rm -rf /usr/local/bin/nimbus_validator_client
sudo userdel validator
}
function uninstallMevboost() {
sudo systemctl stop mevboost
sudo systemctl disable mevboost
sudo rm /etc/systemd/system/mevboost.service
sudo rm /usr/local/bin/mev-boost
sudo userdel mevboost
}
function setWhiptailColors() {
export NEWT_COLORS='root=,black
border=green,black
title=green,black
roottext=red,black
window=red,black
textbox=white,black
button=black,green
compactbutton=white,black
listbox=white,black
actlistbox=black,white
actsellistbox=black,green
checkbox=green,black
actcheckbox=black,green'
}
setWhiptailColors
promptYesNo