Исправлена циклическая установка зависимостей (v1.5.5)

This commit is contained in:
Petro1990 2026-03-13 22:32:46 +03:00
parent a916cd2e5a
commit 23df39d38d
1 changed files with 11 additions and 10 deletions

19
rproxy
View File

@ -3,7 +3,7 @@
# Публикация локальных сервисов через SSH-туннели + nginx на VPS # Публикация локальных сервисов через SSH-туннели + nginx на VPS
# http://5.104.75.50:3000/Petro1990/rProxy # http://5.104.75.50:3000/Petro1990/rProxy
VERSION="1.5.4" VERSION="1.5.5"
export PATH="/opt/bin:/opt/sbin:$PATH" export PATH="/opt/bin:/opt/sbin:$PATH"
CONF_DIR="/opt/etc/rproxy" CONF_DIR="/opt/etc/rproxy"
CONF_FILE="$CONF_DIR/rproxy.conf" CONF_FILE="$CONF_DIR/rproxy.conf"
@ -136,21 +136,23 @@ EOF
ensure_local_deps() { ensure_local_deps() {
local missing="" local missing=""
# Внутренняя функция для надежной проверки
_has_cmd() {
command -v "$1" >/dev/null 2>&1 || [ -x "/opt/bin/$1" ] || [ -x "/opt/sbin/$1" ]
}
# Проверка openssl # Проверка openssl
if ! command -v openssl >/dev/null 2>&1; then if ! _has_cmd openssl; then
missing="$missing openssl-util" missing="$missing openssl-util"
fi fi
# Проверка sshpass # Проверка sshpass
if ! command -v sshpass >/dev/null 2>&1; then if ! _has_cmd sshpass; then
# Дополнительная проверка через opkg на случай если бинарник не в PATH
if ! opkg list-installed sshpass | grep -q sshpass; then
missing="$missing sshpass" missing="$missing sshpass"
fi fi
fi
# Проверка curl (нужен для обновлений) # Проверка curl
if ! command -v curl >/dev/null 2>&1; then if ! _has_cmd curl; then
missing="$missing curl" missing="$missing curl"
fi fi
@ -162,7 +164,6 @@ ensure_local_deps() {
msg "Установка $pkg..." msg "Установка $pkg..."
opkg install "$pkg" >/dev/null 2>&1 opkg install "$pkg" >/dev/null 2>&1
done done
# Даем время системе обновить кеш путей
hash -r 2>/dev/null hash -r 2>/dev/null
msg "Все зависимости установлены." msg "Все зависимости установлены."
fi fi