From b1f91237e3fc260356e99dd4aa506d237fba9d0a Mon Sep 17 00:00:00 2001 From: Snowy-Fluffy Date: Mon, 31 Mar 2025 20:11:36 +0300 Subject: [PATCH] bug fix --- README.md | 5 +++-- zapret-control.sh | 13 +++++++++---- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index c0c36fc..49316b6 100644 --- a/README.md +++ b/README.md @@ -23,12 +23,13 @@ zapret - Debian-подобные - Fedora-подобные - Arch-подобные +- Alt Linux - Void - Gentoo - Openwrt -Частичная поддержка ruinit, procd, OpenRC и SysVinit -(Systemd полностью поддерживается и корректно работает). +Частичная поддержка ruinit, OpenRC и SysVinit +(Systemd и procd полностью поддерживается и корректно работает). О всех багах и недочётах сообщайте в issues или в моём [Telegram-канале](https://t.me/linux_hi). Поддержка других init-систем и дистрибутивов будет добавлена в дальнейшем. diff --git a/zapret-control.sh b/zapret-control.sh index cff4900..1f8a19f 100755 --- a/zapret-control.sh +++ b/zapret-control.sh @@ -290,9 +290,9 @@ install_dependencies() { kernel="$(uname -s)" if [ "$kernel" = "Linux" ]; then . /etc/os-release - + declare -A command_by_ID=( - ["arch"]="pacman -S --noconfirm iptables ipset" + ["arch"]="pacman -S --noconfirm ipset" ["debian"]="apt-get install -y iptables ipset" ["fedora"]="dnf install -y iptables ipset" ["ubuntu"]="apt-get install -y iptables ipset" @@ -306,8 +306,13 @@ install_dependencies() { if [[ -v command_by_ID[$ID] ]]; then eval "${command_by_ID[$ID]}" - elif [[ -v command_by_ID[$ID_LIKE] ]]; then - eval "${command_by_ID[$ID_LIKE]}" + else + for like in $ID_LIKE; do + if [[ -n "${command_by_ID[$like]}" ]]; then + eval "${command_by_ID[$like]}" + break + fi + done fi elif [ "$kernel" = "Darwin" ]; then error_exit "macOS не поддерживается на данный момент."