From 31c4265716a76945d4c5ae56903f23e24d7b1ad3 Mon Sep 17 00:00:00 2001 From: PTah Date: Thu, 28 May 2026 08:24:09 +1000 Subject: [PATCH] fix: log_action to stderr so captured paths stay valid find_remote_ssh_monitor_path output was polluted by log_action on stdout, breaking -f checks; mirror user messages to stderr instead. --- update_ssh_monitor.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/update_ssh_monitor.sh b/update_ssh_monitor.sh index 9279798..b362e10 100755 --- a/update_ssh_monitor.sh +++ b/update_ssh_monitor.sh @@ -216,11 +216,11 @@ log_message() { fi } -# Всегда в лог; в stdout — если не --quiet (удобно при ручном запуске и cron с mail) +# Всегда в лог; в stderr — если не --quiet (stdout не трогаем: его используют $(find_*)) log_action() { log_message "INFO" "$1" if [ "$QUIET" -eq 0 ]; then - printf '[update_ssh_monitor] %s\n' "$1" + printf '[update_ssh_monitor] %s\n' "$1" >&2 fi } @@ -782,6 +782,8 @@ update_script() { sync_installed_updater_from_clone "$@" actual_script_path="$(find_remote_ssh_monitor_path 2>/dev/null || true)" + actual_script_path="${actual_script_path//$'\n'/}" + actual_script_path="${actual_script_path//$'\r'/}" debug_step "Путь к ssh-monitor в клоне: ${actual_script_path:-не найден}" SAC_CLIENT_CHANGED=0