11#! /bin/bash
22full=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
78done
89
9- # Проверить sudo
1010if [ " $( id -u) " != " 0" ]; then
1111 echo " Please run script as root"
1212 exit 1
1313fi
1414
15- # Цвета
1615COLOR=' \033[34m'
1716ENDC=' \033[0m'
1817
19- # Остановка служб
2018systemctl stop validator
2119systemctl stop mytoncore
2220systemctl stop dht-server
2321systemctl stop btc_teleport
22+ systemctl stop ton_storage
2423
25- # Переменные
2624str=$( systemctl cat mytoncore | grep User | cut -d ' =' -f2)
2725user=$( echo ${str} )
2826
29- # Удаление служб
3027rm -rf /etc/systemd/system/validator.service
3128rm -rf /etc/systemd/system/mytoncore.service
3229rm -rf /etc/systemd/system/dht-server.service
3330rm -rf /etc/systemd/system/btc_teleport.service
31+ rm -rf /etc/systemd/system/ton_storage.service
32+
3433systemctl daemon-reload
3534
36- # Удаление файлов
3735if $full ; then
3836 echo " removing Ton node"
3937 rm -rf /usr/src/ton
4442
4543rm -rf /usr/src/mytonctrl
4644rm -rf /usr/src/ton-teleport-btc-periphery
45+ rm -rf /usr/src/tonutils-storage
46+ rm -rf /var/ton_storage
4747rm -rf /usr/src/mtc-jsonrpc
4848rm -rf /usr/src/pytonv3
4949rm -rf /tmp/myton*
@@ -52,7 +52,6 @@ rm -rf /usr/local/bin/mytoncore/mytoncore.db
5252rm -rf /home/${user} /.local/share/mytonctrl
5353rm -rf /home/${user} /.local/share/mytoncore/mytoncore.db
5454
55- # Удаление ссылок
5655if $full ; then
5756 echo " removing ton node"
5857 rm -rf /usr/bin/fift
@@ -61,9 +60,7 @@ if $full; then
6160fi
6261rm -rf /usr/bin/mytonctrl
6362
64- # removing pip packages
6563pip3 uninstall -y mytonctrl
6664pip3 uninstall -y ton-http-api
6765
68- # Конец
6966echo -e " ${COLOR} Uninstall Complete${ENDC} "
0 commit comments