3 # Check http://config.privoxy.org/show-status for Conditional #defines enabled
4 # This wrapper starts privoxy on port 8119 and runs conditional-defines.pl
6 # (c) 2022 Roland Rosenfeld <roland@debian.org>
10 TESTSDIR=$(dirname "$0")
12 if [ -z "$AUTOPKGTEST_TMP" ]; then
13 AUTOPKGTEST_TMP=$(mktemp -d)
16 trap 'rm -rf "$AUTOPKGTEST_TMP"' EXIT
18 CONFIG=$AUTOPKGTEST_TMP/config
19 PIDFILE=$AUTOPKGTEST_TMP/privoxy.pid
20 PRIVOXY=$AUTOPKGTEST_TMP/privoxy
22 sed -e "s/^listen-address.*/listen-address 127.0.0.1:$PORT/" \
23 -e "s%^logdir.*%logdir $AUTOPKGTEST_TMP%" \
24 < /usr/share/privoxy/config > "$CONFIG"
26 cp /usr/sbin/privoxy "$PRIVOXY"
28 echo "Starting privoxy on port $PORT"
29 $PRIVOXY --pidfile "$PIDFILE" "$CONFIG"
31 http_proxy=http://127.0.0.1:$PORT/
34 "$TESTSDIR"/conditional-defines.pl
37 echo "Stopping privoxy on port $PORT"
38 # shellcheck disable=SC2046
39 kill $(cat "$PIDFILE")