exclude_badExits/exclude_badExits.bash

44 lines
1.2 KiB
Bash
Raw Normal View History

2022-11-16 23:15:00 +01:00
#!/bin/bash
# -*- mode: sh; fill-column: 75; tab-width: 8; coding: utf-8-unix -*-
PROG=exclude_badExits.py
SOCKS_PORT=9050
CAFILE=/etc/ssl/certs/ca-certificates.crt
2022-11-29 13:54:36 +01:00
# you may have a special python for installed packages
EXE=`which python3.bash`
2022-11-16 23:15:00 +01:00
2022-11-29 13:54:36 +01:00
$EXE exclude_badExits.py --help > exclude_badExits.hlp &
2022-11-16 23:15:00 +01:00
# an example of running exclude_badExits with full debugging
# expected to take an hour or so
declare -a LARGS
LARGS=(
2022-11-29 13:54:36 +01:00
# --strict_nodes 1
--points_timeout 120
2022-11-16 23:15:00 +01:00
--log_level 10
2022-11-29 13:54:36 +01:00
--https_cafile $CAFILE
2022-11-16 23:15:00 +01:00
)
LARGS+=(
--proxy-host 127.0.0.1
--proxy-port $SOCKS_PORT
)
if [ -f '/run/tor/control' ] ; then
LARGS+=(--proxy-ctl '/run/tor/control' )
else
LARGS+=(--proxy-ctl 9051 )
fi
ddg=duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad
# for example, whitelist the introduction points to DuckDuckGo
LARGS+=( --white_onions $ddg )
# you may need to be the tor user to read /run/tor/control
grep -q ^debian-tor /etc/group && TORU=debian-tor || {
grep -q ^tor /etc/group && TORU=tor
2022-11-29 13:54:36 +01:00
}
# --saved_only
sudo -u $TORU $EXE exclude_badExits.py "${LARGS[@]}" "$@" \
2022-11-16 23:15:00 +01:00
2>&1|tee exclude_badExits6.log
# The DEBUG statements contain the detail of why the relay was considered bad.