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 будет пропущена."