chore: align ssh monitor and SAC module version 1.2.6-SAC

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
PTah
2026-05-28 13:01:51 +10:00
parent 8c542624eb
commit 3e1199e2ec
6 changed files with 25 additions and 12 deletions
+20 -8
View File
@@ -305,15 +305,24 @@ read_ssh_monitor_version() {
printf '%s' "$line"
}
# Версия SAC-модуля совпадает с SSH_MONITOR_VERSION основного скрипта в том же каталоге.
read_sac_client_version() {
local f="$1"
local line
[ -f "$f" ] || return 0
line=$(grep -E '^# SAC client release:' "$f" 2>/dev/null | head -1) || return 0
line=${line#*release: }
line=${line%% —*}
line=${line%% *}
printf '%s' "$line"
local sac_file="$1"
local dir="${sac_file%/*}"
read_ssh_monitor_version "$dir/ssh-monitor"
}
warn_version_mismatch() {
local repo_ssh="$1"
local repo_ver vt
repo_ver="$(read_ssh_monitor_version "$repo_ssh")"
[ -f "$repo_ssh" ] || return 0
if [ -f "${repo_ssh%/*}/version.txt" ]; then
vt="$(tr -d '\r\n' < "${repo_ssh%/*}/version.txt")"
if [ -n "$repo_ver" ] && [ -n "$vt" ] && [ "$repo_ver" != "$vt" ]; then
log_action "WARN: SSH_MONITOR_VERSION=$repo_ver != version.txt=$vt"
fi
fi
}
file_sha256() {
@@ -855,6 +864,9 @@ update_script() {
actual_script_path="${actual_script_path//$'\n'/}"
actual_script_path="${actual_script_path//$'\r'/}"
debug_step "Путь к ssh-monitor в клоне: ${actual_script_path:-не найден}"
if [ -n "$actual_script_path" ] && [ -f "$actual_script_path" ]; then
warn_version_mismatch "$actual_script_path"
fi
SAC_CLIENT_CHANGED=0
if ! sync_sac_client; then