fix(delete-custom): удалять hysteria-server@.service и /etc/hysteria полностью
This commit is contained in:
+13
-5
@@ -140,10 +140,18 @@ if [[ $REMOVE_HYSTERIA -eq 1 ]]; then
|
|||||||
# Удаляем systemd unit
|
# Удаляем systemd unit
|
||||||
if [[ -f /etc/systemd/system/hysteria-server.service ]]; then
|
if [[ -f /etc/systemd/system/hysteria-server.service ]]; then
|
||||||
rm -f /etc/systemd/system/hysteria-server.service
|
rm -f /etc/systemd/system/hysteria-server.service
|
||||||
systemctl daemon-reload
|
|
||||||
log "Unit hysteria-server.service удалён"
|
log "Unit hysteria-server.service удалён"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Удаляем шаблон unit'а (hysteria-server@.service)
|
||||||
|
if [[ -f /etc/systemd/system/hysteria-server@.service ]]; then
|
||||||
|
rm -f /etc/systemd/system/hysteria-server@.service
|
||||||
|
log "Unit hysteria-server@.service удалён"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Перезагружаем systemd
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
# Удаляем бинарник
|
# Удаляем бинарник
|
||||||
if command -v hysteria &>/dev/null; then
|
if command -v hysteria &>/dev/null; then
|
||||||
HYSTERIA_BIN="$(command -v hysteria)"
|
HYSTERIA_BIN="$(command -v hysteria)"
|
||||||
@@ -151,10 +159,10 @@ if [[ $REMOVE_HYSTERIA -eq 1 ]]; then
|
|||||||
log "Бинарник hysteria удалён: $HYSTERIA_BIN"
|
log "Бинарник hysteria удалён: $HYSTERIA_BIN"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Удаляем конфиг
|
# Удаляем конфиг и пустую директорию
|
||||||
if [[ -f /etc/hysteria/config.yaml ]]; then
|
if [[ -d /etc/hysteria ]]; then
|
||||||
rm -f /etc/hysteria/config.yaml
|
rm -rf /etc/hysteria
|
||||||
log "Конфиг Hysteria удалён"
|
log "Директория /etc/hysteria удалена"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Удаляем firewall правила Hysteria
|
# Удаляем firewall правила Hysteria
|
||||||
|
|||||||
Reference in New Issue
Block a user