Update Str3.sh

косметика
This commit is contained in:
StressOzz authored and GitHub committed 2025-11-30 16:37:19 +05:00
1 parent 0db7fda9ce
commit 36bc10a3a1
1 file changed
+8 -8
+8 -8
View File
@@ -7,8 +7,8 @@ BLUE="\033[0;34m"
NC="\033[0m" NC="\033[0m"
# Версия стратегии # Версия стратегии
version="v3" version="v3"
echo -e "${MAGENTA}Устанавливаем стратегию ${version}${NC}\n" echo -e "${MAGENTA}Устанавливаем стратегию ${version}${NC}"
echo -e "${GREEN}🔴 ${CYAN}Меняем стратегию${NC}" echo -e "${CYAN}Меняем стратегию${NC}"
# Удаляем строку и всё, что идёт ниже строки с option NFQWS_OPT ' # Удаляем строку и всё, что идёт ниже строки с option NFQWS_OPT '
sed -i "/^[[:space:]]*option NFQWS_OPT '/,\$d" /etc/config/zapret sed -i "/^[[:space:]]*option NFQWS_OPT '/,\$d" /etc/config/zapret
# Вставляем новый блок сразу после строки option NFQWS_OPT ' # Вставляем новый блок сразу после строки option NFQWS_OPT '
@@ -37,21 +37,21 @@ cat <<EOF >> /etc/config/zapret
' '
EOF EOF
# Проверка и перезапись файла исключений пользователей # Проверка и перезапись файла исключений пользователей
echo -e "${GREEN}🔴 ${CYAN}Добавляем домены в исключения" echo -e "${CYAN}Добавляем домены в исключения"
exclude_file="/opt/zapret/ipset/zapret-hosts-user-exclude.txt" exclude_file="/opt/zapret/ipset/zapret-hosts-user-exclude.txt"
remote_url="https://raw.githubusercontent.com/StressOzz/Zapret-Manager/refs/heads/main/zapret-hosts-user-exclude.txt" remote_url="https://raw.githubusercontent.com/StressOzz/Zapret-Manager/refs/heads/main/zapret-hosts-user-exclude.txt"
# Удаляем старый файл # Удаляем старый файл
rm -f "$exclude_file" rm -f "$exclude_file"
# Скачиваем новый файл на его место # Скачиваем новый файл на его место
if ! curl -fsSL "$remote_url" -o "$exclude_file"; then if ! curl -fsSL "$remote_url" -o "$exclude_file"; then
echo -e "\n${RED}Не удалось загрузить список с GitHub!${NC}\n" echo -e "\n${RED}Не удалось загрузить список с GitHub!${NC}"
read -p "Нажмите Enter для выхода в главное меню..." dummy read -p "Нажмите Enter для выхода в главное меню..." dummy
fi fi
# копируем tls_clienthello_t2_ru.bin # копируем tls_clienthello_t2_ru.bin
echo -e "${GREEN}🔴 ${CYAN}Копируем ${NC}tls_clienthello_t2_ru.bin${CYAN} на устройство${NC}" echo -e "${CYAN}Копируем ${NC}tls_clienthello_t2_ru.bin${CYAN} на устройство${NC}"
curl -sLo /opt/zapret/files/fake/tls_clienthello_t2_ru.bin https://github.com/StressOzz/Zapret-Manager/raw/refs/heads/main/tls_clienthello_t2_ru.bin curl -sLo /opt/zapret/files/fake/tls_clienthello_t2_ru.bin https://github.com/StressOzz/Zapret-Manager/raw/refs/heads/main/tls_clienthello_t2_ru.bin
# Редактируем /etc/hosts # Редактируем /etc/hosts
echo -e "${GREEN}🔴 ${CYAN}Редактируем ${NC}/etc/hosts" echo -e "${CYAN}Редактируем ${NC}/etc/hosts"
file="/etc/hosts" file="/etc/hosts"
cat <<'EOF' | grep -Fxv -f "$file" 2>/dev/null >> "$file" cat <<'EOF' | grep -Fxv -f "$file" 2>/dev/null >> "$file"
130.255.77.28 ntc.party 130.255.77.28 ntc.party
@@ -62,6 +62,6 @@ cat <<'EOF' | grep -Fxv -f "$file" 2>/dev/null >> "$file"
EOF EOF
/etc/init.d/dnsmasq restart >/dev/null 2>&1 /etc/init.d/dnsmasq restart >/dev/null 2>&1
# Применяем конфиг # Применяем конфиг
echo -e "${GREEN}🔴 ${CYAN}Применяем новую стратегию и настройки${NC}\n" echo -e "${CYAN}Применяем новую стратегию и настройки${NC}"
chmod +x /opt/zapret/sync_config.sh && /opt/zapret/sync_config.sh && /etc/init.d/zapret restart >/dev/null 2>&1 chmod +x /opt/zapret/sync_config.sh && /opt/zapret/sync_config.sh && /etc/init.d/zapret restart >/dev/null 2>&1
echo -e "${BLUE}🔴 ${GREEN}Стратегия ${version} установлена!${NC}\n" echo -e "${GREEN}Стратегия ${NC}${version} ${GREEN}установлена!${NC}"