-
Notifications
You must be signed in to change notification settings - Fork 9
/
uninstall.sh
executable file
·172 lines (144 loc) · 4.58 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
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
#!/bin/bash
# Author: coincashew.eth | coincashew.com
# License: GNU GPL
# Source: https://github.com/coincashew
#
# Made for home and solo stakers 🏠🥩
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
cleanupMisc
uninstallPlugins
whiptail --title "Uninstall finished" --msgbox "You have uninstalled this staking node and all validator keys." 8 78
else
echo "Cancelled uninstall." && return 1
fi
}
function uninstallPlugins(){
if [[ -d /opt/ethpillar/plugin-csm ]]; then
sudo systemctl stop csm_nimbusvalidator
sudo systemctl disable csm_nimbusvalidator
sudo rm /etc/systemd/system/csm_nimbusvalidator.service
sudo userdel csm_nimbus_validator
sudo rm -rf /opt/ethpillar/plugin-csm;
fi
if [[ -d /opt/ethpillar/plugin-sentinel ]]; then
sudo docker stop csm-sentinel
sudo docker rm csm-sentinel
sudo docker rmi csm-sentinel
sudo docker volume rm csm-sentinel-persistent
sudo rm -rf /opt/ethpillar/plugin-sentinel
fi
}
function cleanupMisc(){
if [[ -f /etc/systemd/system/ethereum-metrics-exporter.service ]]; then
sudo rm /etc/apt/sources.list.d/grafana.list
sudo systemctl disable ethereum-metrics-exporter
sudo systemctl stop ethereum-metrics-exporter
sudo rm /etc/systemd/system/ethereum-metrics-exporter.service
sudo rm /usr/local/bin/ethereum-metrics-exporter
sudo systemctl disable grafana-server prometheus prometheus-node-exporter
sudo systemctl stop grafana-server prometheus prometheus-node-exporter
sudo apt remove -y grafana prometheus prometheus-node-exporter
fi
if [[ -f /usr/local/bin/eth-duties ]]; then sudo rm /usr/local/bin/eth-duties; fi
if [[ -f /usr/local/bin/ethdo ]]; then sudo rm /usr/local/bin/ethdo; fi
if [[ -f $BASE_DIR/.env.overrides ]]; then sudo rm $BASE_DIR/.env.overrides; fi
}
function uninstallCL(){
if [[ -f /etc/systemd/system/consensus.service ]]; then
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
#Prysm from Binaries
sudo rm -rf /usr/local/bin/beacon-chain
#Prysm from Build from Source
sudo rm -rf /usr/local/bin/prysm
sudo rm -rf /var/lib/prysm
sudo userdel consensus
fi
}
function uninstallEL(){
if [[ -f /etc/systemd/system/execution.service ]]; then
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
fi
}
function uninstallVC(){
if [[ -f /etc/systemd/system/validator.service ]]; then
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
#Prysm from Binaries
sudo rm -rf /usr/local/bin/validator
sudo rm -rf /var/lib/prysm/validators
sudo userdel validator
fi
}
function uninstallMevboost(){
if [[ -f /etc/systemd/system/mevboost.service ]]; then
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
fi
}
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