From e06a9a56fc32fa84dc5f6474755b12f40b29332a Mon Sep 17 00:00:00 2001 From: Auto Fix Date: Mon, 11 May 2026 08:32:47 +0400 Subject: [PATCH] fix(install): --version instead of --help for nfqws check; fix(runner): trailing slash + strip quotes from .bat paths --- install_nfqws.sh | 11 ++++++----- run_strategy.sh | 7 +++++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/install_nfqws.sh b/install_nfqws.sh index 2c27ca6..75d4632 100755 --- a/install_nfqws.sh +++ b/install_nfqws.sh @@ -113,8 +113,9 @@ if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then exit 1 fi -# Verify the binary actually runs (catch segfaults early) -if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then +# Verify the binary actually runs (catch segfaults early). +# Use --version because --help exits with code 1 in zapret. +if ! "$BUILD_DIR/zapret/nfq/nfqws" --version > /dev/null 2>&1; then echo "[!] nfqws segfaults with current flags. Rebuilding with -O0 (no optimizations)..." sed -i 's/-Os/-O0/g' nfq/Makefile 2>/dev/null || true sed -E -i 's/(^| )-s($| )/\1\2/g' nfq/Makefile 2>/dev/null || true @@ -123,14 +124,14 @@ if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then echo "[!] nfqws binary not found after rebuild" exit 1 fi - if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then + if ! "$BUILD_DIR/zapret/nfq/nfqws" --version > /dev/null 2>&1; then echo "[!] nfqws still segfaults with -O0. Last attempt: disable LTO + gc-sections..." - make -C nfq clean && CC=gcc CFLAGS="-std=gnu99 -O0 -g" LDFLAGS="" LIBS_LINUX="-lz -lnetfilter_queue -lnfnetlink -lmnl" make -C nfq + make -C nfq clean && CC=gcc CFLAGS="-std=gnu99 -O0 -g" LDFLAGS="" make -C nfq if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then echo "[!] nfqws binary not found after rebuild" exit 1 fi - if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then + if ! "$BUILD_DIR/zapret/nfq/nfqws" --version > /dev/null 2>&1; then echo "[!] nfqws still segfaults. Aborting." exit 1 fi diff --git a/run_strategy.sh b/run_strategy.sh index 5fedfb6..8f14530 100755 --- a/run_strategy.sh +++ b/run_strategy.sh @@ -45,11 +45,14 @@ parse_conf_args() { # Substitute variables using sed (no envsubst dependency) rule_value=$(echo "$rule_value" | sed \ - -e "s|%BIN%|$BIN_DIR|g" \ - -e "s|%LISTS%|$LISTS_DIR|g" \ + -e "s|%BIN%|$BIN_DIR/|g" \ + -e "s|%LISTS%|$LISTS_DIR/|g" \ -e "s|%GAME_TCP%|${GameFilterTCP:-}|g" \ -e "s|%GAME_UDP%|${GameFilterUDP:-}|g") + # Remove surrounding quotes added by .bat conversion around path args + rule_value=$(echo "$rule_value" | sed -E 's/="([^"]*)"/=\1/g') + # Skip rule if game filter placeholders remain but filter is empty if [[ "$rule_value" == *'%GAME_TCP%'* ]] && [[ -z "${GameFilterTCP:-}" ]]; then continue