diff --git a/lib/telemt.sh b/lib/telemt.sh index 938759f..3af9484 100755 --- a/lib/telemt.sh +++ b/lib/telemt.sh @@ -187,8 +187,20 @@ EOF } # ── Управление сервисом ────────────────────────────────────────────────────── +# start_telemt ensures telemt is running with the CURRENT on-disk config. +# If the service is already active we must restart (not plain start) — otherwise +# the running process keeps its old in-memory config and the freshly generated +# /etc/telemt/config.toml is silently ignored. This was the root cause of the +# "lite-mode key doesn't work after reinstall" bug: telemt had loaded the +# previous Pro config (tls_domain=anten-ka.com) and was rejecting SNI=google.com +# clients with unknown_sni_action=Drop even though the on-disk config said +# tls_domain=google.com. start_telemt() { - systemctl start "$TELEMT_SERVICE" 2>/dev/null + if systemctl is-active --quiet "$TELEMT_SERVICE" 2>/dev/null; then + systemctl restart "$TELEMT_SERVICE" 2>/dev/null + else + systemctl start "$TELEMT_SERVICE" 2>/dev/null + fi sleep 2 if systemctl is-active --quiet "$TELEMT_SERVICE"; then log_success "telemt запущен"