#!/usr/bin/env bash # Verifies that CHECK_PROXY_IP_DOMAIN (ip.podkop.fyi) always routes to a real # proxy outbound when available, regardless of whether direct DPI-bypass sections # (like zapret2) appear before or after proxy sections in UCI config. set -eo pipefail ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" TACHYON_LIB="$ROOT_DIR/tachyon/files/usr/lib" GENERATOR_UC="$TACHYON_LIB/singbox/generator.uc" WORK_DIR="$(mktemp -d)" cleanup() { rm -rf "$WORK_DIR" } trap cleanup EXIT fail() { printf 'FAIL: %s\n' "$1" >&2 exit 1 } generate_config() { local fixture="$1" output="$2" mkdir -p "${output}.section-cache" ucode -L "$TACHYON_LIB" "$GENERATOR_UC" generate-config-fixture \ "$fixture" "$output" "127.0.0.1" } # 1. zapret2 section is placed BEFORE proxy section cat >"$WORK_DIR/zapret_first.json" <"$WORK_DIR/proxy_first.json" <"$WORK_DIR/zapret_only.json" <