fix(install): --version instead of --help for nfqws check; fix(runner): trailing slash + strip quotes from .bat paths

This commit is contained in:
Auto Fix
2026-05-11 08:32:47 +04:00
parent e47a7e2461
commit e06a9a56fc
2 changed files with 11 additions and 7 deletions

View File

@@ -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

View File

@@ -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