chore: align ssh monitor and SAC module version 1.2.6-SAC
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -155,7 +155,7 @@ bash -n ./ssh-monitor
|
||||
|
||||
## Релизный архив
|
||||
|
||||
Версия задаётся в скрипте переменной **`SSH_MONITOR_VERSION`** (на момент последнего обновления документации — **1.2.2-SAC**; актуальное значение смотрите в файле **`ssh-monitor`**). Сборка tarball из текущего git-дерева:
|
||||
Версия задаётся в **`SSH_MONITOR_VERSION`** в файле **`ssh-monitor`** и дублируется в **`version.txt`** (сейчас **1.2.6-SAC**). Модуль **`sac-client.sh`** использует ту же версию для SAC `product_version`. Сборка tarball из текущего git-дерева:
|
||||
|
||||
```bash
|
||||
make dist
|
||||
|
||||
+1
-1
@@ -153,7 +153,7 @@ bash -n ./ssh-monitor
|
||||
|
||||
## Release tarball
|
||||
|
||||
Version is set in the script as **`SSH_MONITOR_VERSION`** (as of last doc update — **1.2.2-SAC**; see the **`ssh-monitor`** file for the current value). Build from the git tree:
|
||||
Version is set as **`SSH_MONITOR_VERSION`** in **`ssh-monitor`** and **`version.txt`** (currently **1.2.6-SAC**). **`sac-client.sh`** reports the same version to SAC. Build from the git tree:
|
||||
|
||||
```bash
|
||||
make dist
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
# SAC client for ssh-monitor (source from ssh-monitor)
|
||||
# SAC client release: 1.2.6-SAC — host.display_name from SERVER_DISPLAY_NAME
|
||||
# Версия для SAC = SSH_MONITOR_VERSION в ssh-monitor (отдельный номер здесь не задаётся).
|
||||
# shellcheck shell=bash
|
||||
|
||||
sac_normalize_mode() {
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ IFS=$'\n\t'
|
||||
# ============================================
|
||||
|
||||
CONFIG_FILE="/etc/ssh-monitor.conf"
|
||||
SSH_MONITOR_VERSION="1.2.5-SAC"
|
||||
SSH_MONITOR_VERSION="1.2.6-SAC"
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
if [ -f "$SCRIPT_DIR/sac-client.sh" ]; then
|
||||
|
||||
+20
-8
@@ -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
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1.2.6-SAC
|
||||
Reference in New Issue
Block a user