fix(install): --version instead of --help for nfqws check; fix(runner): trailing slash + strip quotes from .bat paths
This commit is contained in:
@@ -113,8 +113,9 @@ if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify the binary actually runs (catch segfaults early)
|
# Verify the binary actually runs (catch segfaults early).
|
||||||
if ! "$BUILD_DIR/zapret/nfq/nfqws" --help > /dev/null 2>&1; then
|
# 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)..."
|
echo "[!] nfqws segfaults with current flags. Rebuilding with -O0 (no optimizations)..."
|
||||||
sed -i 's/-Os/-O0/g' nfq/Makefile 2>/dev/null || true
|
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
|
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"
|
echo "[!] nfqws binary not found after rebuild"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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..."
|
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
|
if [ ! -f "$BUILD_DIR/zapret/nfq/nfqws" ]; then
|
||||||
echo "[!] nfqws binary not found after rebuild"
|
echo "[!] nfqws binary not found after rebuild"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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."
|
echo "[!] nfqws still segfaults. Aborting."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|||||||
@@ -45,11 +45,14 @@ parse_conf_args() {
|
|||||||
|
|
||||||
# Substitute variables using sed (no envsubst dependency)
|
# Substitute variables using sed (no envsubst dependency)
|
||||||
rule_value=$(echo "$rule_value" | sed \
|
rule_value=$(echo "$rule_value" | sed \
|
||||||
-e "s|%BIN%|$BIN_DIR|g" \
|
-e "s|%BIN%|$BIN_DIR/|g" \
|
||||||
-e "s|%LISTS%|$LISTS_DIR|g" \
|
-e "s|%LISTS%|$LISTS_DIR/|g" \
|
||||||
-e "s|%GAME_TCP%|${GameFilterTCP:-}|g" \
|
-e "s|%GAME_TCP%|${GameFilterTCP:-}|g" \
|
||||||
-e "s|%GAME_UDP%|${GameFilterUDP:-}|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
|
# Skip rule if game filter placeholders remain but filter is empty
|
||||||
if [[ "$rule_value" == *'%GAME_TCP%'* ]] && [[ -z "${GameFilterTCP:-}" ]]; then
|
if [[ "$rule_value" == *'%GAME_TCP%'* ]] && [[ -z "${GameFilterTCP:-}" ]]; then
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user