Skip to content

Commit aeb3b0d

Browse files
committed
update uninstall script
1 parent fea34bc commit aeb3b0d

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

scripts/uninstall.sh

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,37 @@
11
#!/bin/bash
22
full=true
3-
while getopts f flag; do
3+
while getopts "f" flag; do
44
case "${flag}" in
5-
f) full=false
5+
f) full=false ;;
6+
*) echo "Usage: $0 [-f]"; exit 1 ;;
67
esac
78
done
89

9-
# Проверить sudo
1010
if [ "$(id -u)" != "0" ]; then
1111
echo "Please run script as root"
1212
exit 1
1313
fi
1414

15-
# Цвета
1615
COLOR='\033[34m'
1716
ENDC='\033[0m'
1817

19-
# Остановка служб
2018
systemctl stop validator
2119
systemctl stop mytoncore
2220
systemctl stop dht-server
2321
systemctl stop btc_teleport
22+
systemctl stop ton_storage
2423

25-
# Переменные
2624
str=$(systemctl cat mytoncore | grep User | cut -d '=' -f2)
2725
user=$(echo ${str})
2826

29-
# Удаление служб
3027
rm -rf /etc/systemd/system/validator.service
3128
rm -rf /etc/systemd/system/mytoncore.service
3229
rm -rf /etc/systemd/system/dht-server.service
3330
rm -rf /etc/systemd/system/btc_teleport.service
31+
rm -rf /etc/systemd/system/ton_storage.service
32+
3433
systemctl daemon-reload
3534

36-
# Удаление файлов
3735
if $full; then
3836
echo "removing Ton node"
3937
rm -rf /usr/src/ton
@@ -44,6 +42,8 @@ fi
4442

4543
rm -rf /usr/src/mytonctrl
4644
rm -rf /usr/src/ton-teleport-btc-periphery
45+
rm -rf /usr/src/tonutils-storage
46+
rm -rf /var/ton_storage
4747
rm -rf /usr/src/mtc-jsonrpc
4848
rm -rf /usr/src/pytonv3
4949
rm -rf /tmp/myton*
@@ -52,7 +52,6 @@ rm -rf /usr/local/bin/mytoncore/mytoncore.db
5252
rm -rf /home/${user}/.local/share/mytonctrl
5353
rm -rf /home/${user}/.local/share/mytoncore/mytoncore.db
5454

55-
# Удаление ссылок
5655
if $full; then
5756
echo "removing ton node"
5857
rm -rf /usr/bin/fift
@@ -61,9 +60,7 @@ if $full; then
6160
fi
6261
rm -rf /usr/bin/mytonctrl
6362

64-
# removing pip packages
6563
pip3 uninstall -y mytonctrl
6664
pip3 uninstall -y ton-http-api
6765

68-
# Конец
6966
echo -e "${COLOR}Uninstall Complete${ENDC}"

0 commit comments

Comments
 (0)