From 9f91b78335109a3442f7ccbbdc27b038f6e7be66 Mon Sep 17 00:00:00 2001 From: StressOzz <131419324+StressOzz@users.noreply.github.com> Date: Thu, 3 Sep 2026 19:37:36 +0500 Subject: [PATCH] Update Zapret-Manager.sh --- Zapret-Manager.sh | 150 +++++++++++++++++++++++++++++++--------------- 1 file changed, 103 insertions(+), 47 deletions(-) diff --git a/Zapret-Manager.sh b/Zapret-Manager.sh index a07eca8..eda7c65 100644 --- a/Zapret-Manager.sh +++ b/Zapret-Manager.sh @@ -105,7 +105,9 @@ GITH="#github.com\n140.82.114.3 github.com\n185.199.110.154 github.githubassets. USoft="#Ubisoft\n52.6.7.14 ubi.com\n172.67.139.108 r6s.com\n54.155.2.87 rainbow6.com\n52.222.149.31 ubisoft.com\n54.76.54.196 uplay.ubisoft.com\n2.23.89.92 static3.cdn.ubi.com 18.209.141.203 connect.ubisoft.com\n2.23.89.244 ubiservices.cdn.ubi.com\n99.83.188.134 public-ubiservices.ubi.com\n3.33.249.140 public-ws-ubiservices.ubi.com\n" ALL_BLOCKS="$AI\n$INSTAGRAM\n$NTC\n$LIBRUSEC\n$TGWeb\n$TWCH\n$SCell\n$SPFY"; TMP_ARCHIVE_RS="/tmp/tg-ws-proxy-rs.tar.gz"; TMP_DIR_RS="/tmp/tg-ws-proxy-rs" -hosts_enabled() { if grep -q "### dns.malw.link" /etc/hosts; then hosts_echo="Malw.link"; return 0; elif grep -q "#mafioznik" /etc/hosts; then hosts_echo="Mafioznik"; return 0; elif grep -q "### dns.geohide.ru" /etc/hosts; then hosts_echo="GeoHide"; return 0 +hosts_enabled() { if grep -q "### dns.malw.link" /etc/hosts; then hosts_echo="Malw.link"; return 0; elif grep -q "#mafioznik" /etc/hosts; then hosts_echo="Mafioznik"; return 0 +elif grep -q "### geohide.ru: hosts file" /etc/hosts; then if grep -q "^# Регион серверов: US$" /etc/hosts; then hosts_echo="GeoHide US"; elif grep -q "^# Регион серверов: EU$" /etc/hosts +then hosts_echo="GeoHide EU"; elif grep -q "^# Регион серверов: RU$" /etc/hosts; then hosts_echo="GeoHide RU"; else hosts_echo="GeoHide"; fi; return 0 elif grep -q "45.155.204.190\|instagram.com\|rutor.info\|lib.rus.ec\|ntc.party\|twitch.tv\|web.telegram.org\|www.spotify.com\|store.supercell.com\|raw.githubusercontent.com\|lkfl2.nalog.ru" /etc/hosts; then hosts_echo="добавлены"; return 0; fi; return 1; } hosts_add() { printf "%b\n" "$1" | while IFS= read -r L; do grep -qxF "$L" /etc/hosts || echo "$L" >> /etc/hosts; done; /etc/init.d/dnsmasq restart >/dev/null 2>&1; }; D() { printf '%b' "$(printf '%s' "$1" | sed 's/../\\x&/g')"; } ZAPRET_RESTART () { chmod +x /opt/zapret/sync_config.sh; /opt/zapret/sync_config.sh; /etc/init.d/zapret restart >/dev/null 2>&1; sleep 1; } @@ -124,39 +126,66 @@ DELETE="opkg remove"; ARCH="$(opkg print-architecture | awk '{print $2}' | tail RAZ="ipk"; TMP_FILE_GO="/tmp/tg-ws-proxy.ipk"; else PKG="apk"; GO_SUF="r1"; CONFZ="/etc/apk/repositories.d/distfeeds.list"; PKG_IS_APK=1; SPL_SUF="noarch"; RELEASE_TAG="v${BYEDPI_LATEST_VER}-25.12" UPDATE="apk update"; INSTALL="apk add --allow-untrusted"; DELETE="apk del"; ARCH="$(apk --print-arch 2>/dev/null)"; RAZ="apk"; VER_SUF="r1"; SUF_MT="r"; TMP_FILE_GO="/tmp/tg-ws-proxy.apk"; fi -# MIRROR=""; CURRENT_MIRROR=$(head -n1 "$CONFZ" | awk '{print $NF}' | sed 's|https://||;s|/releases/.*||') -# if grep -qE 'mirror-03\.infra\.openwrt\.org|ftp\.snt\.utwente\.nl/pub/software/openwrt|mirror\.berlin\.freifunk\.net/downloads\.openwrt|mirror\.sjtu\.edu\.cn/openwrt|ftp\.halifax\.rwth-aachen\.de/openwrt|mirror\.accum\.se/mirror/openwrt|downloads\.openwrt\.org' "$CONFZ"; then -# echo -e "${CYAN}Проверяем доступность ${NC}$CURRENT_MIRROR" -# if ! wget -q --spider --timeout=2 "https://$CURRENT_MIRROR/releases/" >/dev/null 2>&1; then -# echo -e "$CURRENT_MIRROR ${RED}недоступен!${NC}" -# echo -e "${CYAN}Подбираем зеркало ${NC}OpenWRT" -# if wget -q --spider --timeout=3 "https://mirror-03.infra.openwrt.org" >/dev/null 2>&1; then -# MIRROR="mirror-03.infra.openwrt.org" -# elif wget -q --spider --timeout=3 "https://ftp.halifax.rwth-aachen.de/openwrt/releases/" >/dev/null 2>&1; then -# MIRROR="ftp.halifax.rwth-aachen.de/openwrt" -# elif wget -q --spider --timeout=3 "https://mirror.accum.se/mirror/openwrt.org/releases/" >/dev/null 2>&1; then -# MIRROR="mirror.accum.se/mirror/openwrt.org" -# elif wget -q --spider --timeout=3 "https://ftp.snt.utwente.nl/pub/software/openwrt/releases/" >/dev/null 2>&1; then -# MIRROR="ftp.snt.utwente.nl/pub/software/openwrt" -# elif wget -q --spider --timeout=3 "https://mirror.berlin.freifunk.net/downloads.openwrt/releases/" >/dev/null 2>&1; then -# MIRROR="mirror.berlin.freifunk.net/downloads.openwrt" -# elif wget -q --spider --timeout=3 "https://mirror.sjtu.edu.cn/openwrt/releases/" >/dev/null 2>&1; then -# MIRROR="mirror.sjtu.edu.cn/openwrt" -# elif wget -q --spider --timeout=3 "https://downloads.openwrt.org/releases/" >/dev/null 2>&1; then -# MIRROR="downloads.openwrt.org" -# fi -# if [ -n "$MIRROR" ]; then -# echo -e "${CYAN}Переключаемся на ${NC}$MIRROR" -# sed -i "s|https://.*/releases/|https://$MIRROR/releases/|g" "$CONFZ" -# else -# echo -e "${RED}Резервные зеркала недоступны!${NC}" -# fi -# else -# echo -e "$CURRENT_MIRROR ${GREEN}доступен!${NC}" -# fi -# fi +update_packages() { + [ "$PACKAGES_UPDATED" = "1" ] && return 0 + echo -e "${CYAN}Обновляем список пакетов${NC}" + if $UPDATE >/dev/null 2>&1; then + PACKAGES_UPDATED=1 + return 0 + fi + echo -e "${RED}Ошибка обновления списка пакетов!${NC}" + echo -e "${CYAN}Подбираем рабочее зеркало ${NC}OpenWRT" -update_packages(){ [ "$PACKAGES_UPDATED" = "1" ] && return 0; echo -e "${CYAN}Обновляем список пакетов${NC}"; $UPDATE >/dev/null 2>&1 || { echo -e "\n${RED}Ошибка обновления списка пакетов!${NC}\n"; PAUSE; return 1; }; PACKAGES_UPDATED=1; } + [ -f "$CONFZ" ] || { + echo -e "\n${RED}Файл репозиториев не найден: $CONFZ${NC}\n" + PAUSE + return 1 + } + CURRENT_MIRROR=$(head -n1 "$CONFZ" 2>/dev/null | awk '{print $NF}' | sed 's|https\://||;s|/releases/.*||') + cp "$CONFZ" /tmp/distfeeds.conf.bak + +try_mirror() { + MIRROR="$1" + echo -e "${CYAN}Проверяем ${NC}$MIRROR" + if ! wget -q --spider --timeout=3 "https://$MIRROR/releases/" >/dev/null 2>&1; then + echo -e "$MIRROR ${RED}недоступен!${NC}" + return 1 + fi + echo -e "$MIRROR ${GREEN}доступен!${NC}" + sed -i "s|https://.*/releases/|https://$MIRROR/releases/|g" "$CONFZ" + echo -e "${CYAN}Проверяем обновление пакетов${NC}" + if $UPDATE >/dev/null 2>&1; then + echo -e "${GREEN}Обновление пакетов выполнено успешно!${NC}" + echo -e "${CYAN}Используем зеркало: ${NC}$MIRROR" + return 0 + fi + echo -e "${RED}Ошибка обновления пакетов!${NC}" + cp /tmp/distfeeds.conf.bak "$CONFZ" + return 1 +} + + for MIRROR in \ + "mirror-03.infra.openwrt.org" \ + "ftp.halifax.rwth-aachen.de/openwrt" \ + "mirror.accum.se/mirror/openwrt.org" \ + "ftp.snt.utwente.nl/pub/software/openwrt" \ + "mirror.berlin.freifunk.net/downloads.openwrt" \ + "mirror.sjtu.edu.cn/openwrt" \ + "downloads.openwrt.org" + do + [ "$MIRROR" = "$CURRENT_MIRROR" ] && continue + if try_mirror "$MIRROR"; then + rm -f /tmp/distfeeds.conf.bak + PACKAGES_UPDATED=1 + return 0 + fi + done + cp /tmp/distfeeds.conf.bak "$CONFZ" + rm -f /tmp/distfeeds.conf.bak + echo -e "\n${RED}Не удалось найти рабочее зеркало OpenWRT!${NC}\n" + PAUSE + return 1 +} if ! curl --version >/dev/null 2>&1; then echo -e "\ncurl ${RED}отсутствует ${NC}или${RED} работает некорректно${NC}\n"; echo -e "${MAGENTA}Устанавливаем ${NC}curl" $DELETE curl libcurl >/dev/null 2>&1; if ! update_packages; then echo -e "\n${RED}Ошибка обновления списка пакетов!${NC}\n"; else PACKAGES_UPDATED=1; fi @@ -392,16 +421,11 @@ echo -e "${CYAN}4) ${GREEN}Удалить ${NC}splify2" echo -e "${CYAN}5) ${GREEN}Сгенерировать и применить ${NC}WARP ${GREEN}для${NC} splify" echo -e "${CYAN}6) ${GREEN}Перезапустить ${NC}splify" echo -ne "${CYAN}Enter) ${GREEN}Выход в главное меню${NC}\n\n${YELLOW}Выберите пункт:${NC} "; read choiceSP; case "$choiceSP" in - -1) -if [ -f /etc/init.d/steer ]; then echo -e "\n${RED}установлен${NC} splify2\n"; PAUSE; continue; fi - +1) if [ -f /etc/init.d/steer ]; then echo -e "\n${RED}установлен${NC} splify2\n"; PAUSE; continue; fi if [ "$UPD_SPL" = "0" ]; then clear; echo -e "${MAGENTA}Устанавливаем ${NC}splify" install_splify || continue; install_AWG || continue; echo; register_warp || continue; echo -e "${CYAN}Используем ${NC}endpoint${CYAN}:${NC} $WARP_EP"; create_warp_iface || continue; WARP_TO_ROOT; register_in_splify; setup_firewall || continue; restart_splify; echo -e "splify ${GREEN}установлен!${NC}\n" else echo -e "\n${MAGENTA}Обновляем ${NC}splify"; install_splify || continue; register_in_splify; restart_splify; echo -e "splify ${GREEN}обновлён!${NC}\n"; fi; PAUSE ;; 2) DELETE_SPL ;; -3) -if [ -f /etc/init.d/splify ]; then echo -e "\n${RED}установлен${NC} splify"\n; PAUSE; continue; fi - +3) if [ -f /etc/init.d/splify ]; then echo -e "\n${RED}установлен${NC} splify"\n; PAUSE; continue; fi clear; echo -e "${MAGENTA}Запускаем официальный установщик splify2${NC}\n" echo -e "${YELLOW}При выборе движка выбирайте ${NC}1\n" sh -c "$(wget -qO- https://gitlab.com/xyzmean/splify2/-/raw/main/install.sh)"; echo; PAUSE ;; @@ -412,8 +436,7 @@ $DELETE steer-extended >/dev/null 2>&1 $DELETE steer >/dev/null 2>&1 $DELETE luci-app-splify2 >/dev/null 2>&1 rm -rf /etc/config/steer* /etc/config/splify2* /etc/init.d/steer /tmp/*steer* /tmp/*splify2* /etc/steer* /etc/splify2* 2>/dev/null -echo -e "splify2 ${GREEN}удалён!${NC}\n"; PAUSE -;; +echo -e "splify2 ${GREEN}удалён!${NC}\n"; PAUSE;; 5) if [ -z "$SPL_INST_VER" ]; then echo -e "\nsplify ${RED}не установлен!${NC}\n" else register_warp || continue; choose_endpoint || continue; create_warp_iface || continue; WARP_TO_ROOT; register_in_splify; restart_splify; echo -e "\nWARP ${GREEN}изменён!${NC}\n"; fi; PAUSE ;; 6) if [ -z "$SPL_INST_VER" ]; then echo -e "\nsplify ${RED}не установлен!${NC}\n"; else register_in_splify; restart_splify; fi; echo; PAUSE ;; *) return ;; esac; done; } @@ -743,13 +766,14 @@ else opkg list-installed | grep -q '^https-dns-proxy ' && echo -e "${YELLOW}DNS echo -e "${CYAN} 4)${GREEN} Настроить ${NC}Google\n${CYAN} 5)${GREEN} Настроить ${NC}Quad 9\n${CYAN} 6)${GREEN} Настроить ${NC}GeoHide\n${CYAN} 7)${GREEN} Настроить ${NC}Cloudflare\n${CYAN} 8)${GREEN} Настроить ${NC}dns.malw.link\n${CYAN} 9)${GREEN} Настроить ${NC}dns.astracat.ru" echo -e "${CYAN}10)${GREEN} Настроить ${NC}dns.mafioznik.xyz\n${CYAN}11)${GREEN} Настроить ${NC}dns.malw.link (CloudFlare)\n${CYAN}12)${GREEN} Настроить ${NC}dns.nullsproxy.com (Supercell)\n${CYAN}13)${GREEN} Вернуть ${NC}настройки по умолчанию" echo -ne "${CYAN}Enter) ${GREEN}Выход в главное меню${NC}\n\n${YELLOW}Выберите пункт:${NC} "; read -r choiceDOH; [ -z "$choiceDOH" ] && return; case "$choiceDOH" in 1) D_o_H;; 2) doh_install && setup_doh "$doh_xbox" "Xbox";; 3) doh_install && setup_doh "$doh_comss" "Comss.one";; -4) doh_install && setup_doh "$doh_GOO" "Google";; 5) doh_install && setup_doh "$doh_Quad" "Quad 9";; 6) doh_install && setup_doh "$doh_GEOHIDE" "GeoHide";; 7) doh_install && setup_doh "$doh_CLF" "Cloudflare";; 8) doh_install && setup_doh "$doh_query" "dns.malw.link";; +4) doh_install && setup_doh "$doh_GOO" "Google";; 5) doh_install && setup_doh "$doh_Quad" "Quad 9";; 6) doh_install && menu_GEOHIDE_DOH;; 7) doh_install && setup_doh "$doh_CLF" "Cloudflare";; 8) doh_install && setup_doh "$doh_query" "dns.malw.link";; 9) doh_install && setup_doh "$doh_astracat" "dns.astracat.ru";; 10) doh_install && setup_doh "$doh_mafioznik" "dns.mafioznik.xyz";; 11) doh_install && setup_doh "$doh_queryCF" "dns.malw.link (CloudFlare)";; 12) doh_install && setup_doh "$doh_nullsproxy" "dns.nullsproxy.com";; 13) doh_install && setup_doh "$doh_def" "настройки по умолчанию";; *) return;; esac; done; } setup_doh() { local config="$1"; local name="$2"; echo -e "\n${MAGENTA}Настраиваем DNS over HTTPS${NC}\n${CYAN}Настраиваем ${NC}$name\n${CYAN}Применяем новые настройки${NC}" rm -f "$fileDoH"; printf '%s\n' "$doh_set" "$config" > "$fileDoH"; /etc/init.d/https-dns-proxy reload >/dev/null 2>&1; /etc/init.d/https-dns-proxy restart >/dev/null 2>&1; /etc/init.d/dnsmasq restart >/dev/null 2>&1; echo -e "DNS over HTTP ${GREEN}настроен!${NC}\n"; PAUSE; } get_doh_status() { DOH_STATUS=""; [ ! -f "$fileDoH" ] && return; if grep -q "dns.comss.one" "$fileDoH"; then DOH_STATUS="Comss"; elif grep -q "xbox-dns.ru" "$fileDoH"; then DOH_STATUS="Xbox"; elif grep -q "5u35p8m9i7.cloudflare-gateway.com" "$fileDoH" then DOH_STATUS="dns.malw.link (CloudFlare)"; elif grep -q "dns.malw.link" "$fileDoH"; then DOH_STATUS="dns.malw.link"; elif grep -q "dns.mafioznik.xyz" "$fileDoH"; then DOH_STATUS="dns.mafioznik.xyz" -elif grep -q "geohide.ru" "$fileDoH"; then DOH_STATUS="GeoHide"; elif grep -q "cloudflare-dns.com" "$fileDoH" && grep -q "dns.google" "$fileDoH"; then DOH_STATUS="по умолчанию"; elif grep -q "cloudflare-dns.com" "$fileDoH"; then DOH_STATUS="Cloudflare"; elif grep -q "dns.quad9.net" "$fileDoH"; then DOH_STATUS="Quad 9" +elif grep -q "eu.geohide.ru" "$fileDoH"; then DOH_STATUS="GeoHide EU"; elif grep -q "us.geohide.ru" "$fileDoH"; then DOH_STATUS="GeoHide US"; elif grep -q "geohide.ru" "$fileDoH" +then DOH_STATUS="GeoHide RU"; elif grep -q "cloudflare-dns.com" "$fileDoH" && grep -q "dns.google" "$fileDoH"; then DOH_STATUS="по умолчанию"; elif grep -q "cloudflare-dns.com" "$fileDoH"; then DOH_STATUS="Cloudflare"; elif grep -q "dns.quad9.net" "$fileDoH"; then DOH_STATUS="Quad 9" elif grep -q "dns.google" "$fileDoH"; then DOH_STATUS="Google"; elif grep -q "dns.astracat.ru" "$fileDoH"; then DOH_STATUS="dns.astracat.ru"; elif grep -q "dns.nullsproxy.com" "$fileDoH"; then DOH_STATUS="dns.nullsproxy.com"; else DOH_STATUS="установлен"; fi; } D_o_H(){ if { [ "$PKG_IS_APK" -eq 1 ] && apk info -e https-dns-proxy >/dev/null 2>&1; } || { [ "$PKG_IS_APK" -eq 0 ] && opkg list-installed | grep -q '^https-dns-proxy '; }; then echo -e "\n${MAGENTA}Удаляем DNS over HTTPS${NC}\n${CYAN}Удаляем пакеты${NC}"; $DELETE https-dns-proxy luci-app-https-dns-proxy >/dev/null 2>&1; echo -e "${CYAN}Удаляем файлы конфигурации${NC}"; rm -f /etc/config/https-dns-proxy /etc/init.d/https-dns-proxy sed -i -e "/option doh_backup_noresolv '-1'/d" -e "/option noresolv '1'/d" -e "/list doh_backup_server ''/d" -e "/list server '\/mask\.icloud\.com\/'/d" -e "/list server '\/mask-h2\.icloud\.com\/'/d" -e "/list server '\/use-application-dns\.net\/'/d" -e "/list server '127\.0\.0\.1#5053'/d" -e "/list server '127\.0\.0\.1#5054'/d" -e "/list doh_server '127\.0\.0\.1#5053'/d" -e "/list doh_server '127\.0\.0\.1#5054'/d" /etc/config/dhcp @@ -762,7 +786,10 @@ doh_CLF=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https doh_query=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://dns.malw.link/dns-query'"); doh_comss=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://dns.comss.one/dns-query'" " option bootstrap_dns '92.38.152.163,93.115.24.204,2a03:90c0:56::1a5,2a02:7b40:5eb0:e95d::1'") doh_mafioznik=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://dns.mafioznik.xyz/dns-query'"); doh_astracat=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://dns.astracat.ru/dns-query'") doh_GOO=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://dns.google/dns-query'" " option bootstrap_dns '8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844'"); doh_Quad=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://dns.quad9.net/dns-query'" " option bootstrap_dns '9.9.9.9,149.112.112.112,2620:fe::fe,2620:fe::9'") -doh_GEOHIDE=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://geohide.ru/dns-query'"); doh_queryCF=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://5u35p8m9i7.cloudflare-gateway.com/dns-query'" " option bootstrap_dns '8.8.8.8,8.8.4.4,2001:4860:4860::8888,2001:4860:4860::8844'") +doh_queryCF=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://5u35p8m9i7.cloudflare-gateway.com/dns-query'"); doh_GEOHIDE_RU=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://geohide.ru/dns-query'") +doh_GEOHIDE_EU=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://eu.geohide.ru/dns-query'"); doh_GEOHIDE_US=$(printf "%s\n" "" "config https-dns-proxy" " option resolver_url 'https://us.geohide.ru/dns-query'") +menu_GEOHIDE_DOH() { echo -e "\n${MAGENTA}Выберите сервер GeoHide DNS${NC}"; echo -e "${CYAN}1) ${GREEN}GeoHide ${NC}RU\n${CYAN}2) ${GREEN}GeoHide ${NC}EU\n${CYAN}3) ${GREEN}GeoHide ${NC}US\n${CYAN}Enter) ${GREEN}Отменить выбор${NC}\n" +echo -ne "${YELLOW}Выберите пункт:${NC} "; read -r c; case "$c" in 1) setup_doh "$doh_GEOHIDE_RU" "GeoHide RU";; 2) setup_doh "$doh_GEOHIDE_EU" "GeoHide EU";; 3) setup_doh "$doh_GEOHIDE_US" "GeoHide US";; esac; } # ========================================== # Доступ из браузера # ========================================== @@ -833,7 +860,7 @@ echo -e "${CYAN}14) ${GREEN}$(get_state "$TAPEop")${NC} tapeop.dev\n${CYAN}15) $ echo -e "${CYAN}17) ${GREEN}Заменить ${NC}hosts${GREEN} на ${NC}Mafioznik hosts\n${CYAN}18) ${GREEN}Заменить ${NC}hosts${GREEN} на ${NC}Malw.link hosts\n${CYAN}19) ${GREEN}Восстановить ${NC}hosts" echo -ne "${CYAN}Enter) ${GREEN}Выход в главное меню${NC}\n\n${YELLOW}Выберите пункт:${NC} ";read -r c; case "$c" in 0) toggle_block "$NALOG";; 1) toggle_block "$RUTOR";; 2) toggle_block "$NTC";; 3) toggle_block "$INSTAGRAM";; 4) toggle_block "$LIBRUSEC";; 5) toggle_block "$AI";; 6) toggle_block "$TWCH";; 7) toggle_block "$TGWeb";; 8) toggle_block "$SPFY";; 9) toggle_block "$SPFYEXT";; 10) toggle_block "$SCell";; 11) toggle_block "$GITH_RAW";; 12) toggle_block "$GITH";; -13) toggle_block "$USoft";; 14) toggle_block "$TAPEop";; 15) toggle_all;; 16) add_GEO_HOSTS;; 17) echo -e "\n${MAGENTA}Заменяем hosts на Mafioznik hosts${NC}"; wget -qO /etc/hosts ${GH_RAW}/StressOzz/Zapret-Manager/refs/heads/main/files/hosts_mafioznik.txt >/dev/null 2>&1 || { echo -e "\n${RED}Не удалось скачать файл hosts${NC}\n"; PAUSE; } +13) toggle_block "$USoft";; 14) toggle_block "$TAPEop";; 15) toggle_all;; 16) menu_GEO_HOSTS;; 17) echo -e "\n${MAGENTA}Заменяем hosts на Mafioznik hosts${NC}"; wget -qO /etc/hosts ${GH_RAW}/StressOzz/Zapret-Manager/refs/heads/main/files/hosts_mafioznik.txt >/dev/null 2>&1 || { echo -e "\n${RED}Не удалось скачать файл hosts${NC}\n"; PAUSE; } /etc/init.d/dnsmasq restart >/dev/null 2>&1; echo -e "hosts ${GREEN}заменён на ${NC}Mafioznik hosts${GREEN}!${NC}\n"; PAUSE;; 18) echo -e "\n${MAGENTA}Заменяем hosts на Malw.link hosts${NC}" wget -qO /etc/hosts ${GH_RAW}/StressOzz/Zapret-Manager/refs/heads/main/files/hosts_malw.link.txt >/dev/null 2>&1 || { echo -e "\n${RED}Не удалось скачать файл hosts${NC}\n"; PAUSE; } /etc/init.d/dnsmasq restart >/dev/null 2>&1; echo -e "hosts ${GREEN}заменён на ${NC}Malw.link hosts${GREEN}!${NC}\n"; PAUSE;; 19) hosts_reset;; *) break;; esac; done; } @@ -841,6 +868,36 @@ status_block() { local line; while IFS= read -r line; do [ -z "$line" ] && conti $(printf '%b\n' "$1") EOF } +menu_GEO_HOSTS() { + while true; do + echo -e "\n${MAGENTA}Выберите сервер GeoHide${NC}" + echo -e "${CYAN}1) ${GREEN}GeoHide ${NC}RU" + echo -e "${CYAN}2) ${GREEN}GeoHide ${NC}EU" + echo -e "${CYAN}3) ${GREEN}GeoHide ${NC}US" + echo -e "${CYAN}Enter) ${GREEN}Отменить выбор${GREEN}${NC}\n" + echo -ne "${YELLOW}Выберите пункт:${NC} " + read -r c + case "$c" in + 1) GEO_FILE="$GH_RAW/StressOzz/Zapret-Manager/refs/heads/main/files/GeoHide_hosts_RU"; GEO_NAME="RU";; + 2) GEO_FILE="$GH_RAW/StressOzz/Zapret-Manager/refs/heads/main/files/GeoHide_hosts_EU"; GEO_NAME="EU";; + 3) GEO_FILE="$GH_RAW/StressOzz/Zapret-Manager/refs/heads/main/files/GeoHide_hosts_US"; GEO_NAME="US";; + *) break;; + esac + echo -e "\n${MAGENTA}Заменяем hosts на GeoHide ${GEO_NAME} hosts${NC}" + GEO_TMP="/tmp/GeoHide_hosts" + if wget -q -U "Mozilla/5.0" -O "$GEO_TMP" "$GEO_FILE" >/dev/null 2>&1 && + [ -s "$GEO_TMP" ]; then + mv "$GEO_TMP" /etc/hosts + /etc/init.d/dnsmasq restart >/dev/null 2>&1 + echo -e "hosts ${GREEN}заменён на ${NC}GeoHide ${GEO_NAME} hosts${GREEN}!${NC}\n" + else + rm -f "$GEO_TMP" + echo -e "\n${RED}Не удалось скачать GeoHide ${GEO_NAME} hosts${NC}\n" + fi + PAUSE + return + done +} # ========================================== # Тест стратегий # ========================================== @@ -1284,7 +1341,6 @@ ip=$(sed -n "${num}p" "$IDX_LIST"); if [ -z "$ip" ]; then rm -f "$DEV_LIST" "$ID else CURRENT_EXCL=$(printf '%s\n%s\n' "$CURRENT_EXCL" "$ip"); ACTION_MSG="${GREEN}IP ${NC}${ip}${GREEN} добавлен в исключения!${NC}"; fi; CHANGED=1; done ;; esac; CURRENT_EXCL=$(echo "$CURRENT_EXCL" | grep -v '^$' | sort -u) if [ -n "$CURRENT_EXCL" ]; then FORMATTED=$(echo "$CURRENT_EXCL" | tr '\n' ',' | sed 's/,$//' | sed 's/,/, /g'); { echo "EXCEPT_SRC='{ $FORMATTED }'"; echo "nft insert rule inet zapret postrouting_hook index 0 \\"; echo " ip saddr \$EXCEPT_SRC meta mark set meta mark \\| 0x40000000"; } > "$EXCL_FILE"; else : > "$EXCL_FILE"; fi echo -e "\n${CYAN}Применяем и перезапускаем ${NC}Zapret"; ZAPRET_RESTART; echo -e "\n${ACTION_MSG}\n"; PAUSE; rm -f "$DEV_LIST" "$IDX_LIST"; done; } - # ========================================== # Package Installer # ==========================================