From b54437a480fed1c484df9335e1bbb2eaee7d1d98 Mon Sep 17 00:00:00 2001 From: Ruslan Date: Tue, 14 Apr 2026 11:04:15 +0300 Subject: [PATCH] Client: detect apt install candidate for resolvconf packages --- client/install_client.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/client/install_client.sh b/client/install_client.sh index 9c665b1..e8c59b3 100755 --- a/client/install_client.sh +++ b/client/install_client.sh @@ -170,12 +170,19 @@ detect_client_lan_subnets() { } install_packages() { + pkg_has_install_candidate() { + local pkg="$1" + local candidate + candidate="$(apt-cache policy "$pkg" 2>/dev/null | awk '/Candidate:/ {print $2; exit}')" + [[ -n "$candidate" && "$candidate" != "(none)" ]] + } + apt_install_if_missing wireguard wireguard-tools iproute2 openssh-client sshpass ca-certificates if ! command -v resolvconf >/dev/null 2>&1; then - if apt-cache show openresolv >/dev/null 2>&1; then + if pkg_has_install_candidate openresolv; then apt_install_if_missing openresolv - elif apt-cache show resolvconf >/dev/null 2>&1; then + elif pkg_has_install_candidate resolvconf; then apt_install_if_missing resolvconf else log_warn "Пакеты openresolv/resolvconf недоступны. DNS-строка в wg0.conf будет пропущена."