mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-11-27 22:03:31 +01:00
Merge branch 'main' into 'main'
Clean up torify See merge request tpo/core/tor!740
This commit is contained in:
commit
67bfb87dcb
@ -37,25 +37,8 @@ case $1 in -v|--verbose)
|
|||||||
shift
|
shift
|
||||||
esac
|
esac
|
||||||
|
|
||||||
# taken from Debian's Developer's Reference, 6.4
|
if command -v torsocks > /dev/null; then
|
||||||
pathfind() {
|
|
||||||
OLDIFS="$IFS"
|
|
||||||
IFS=:
|
|
||||||
for p in $PATH; do
|
|
||||||
if [ -x "$p/$*" ]; then
|
|
||||||
IFS="$OLDIFS"
|
|
||||||
return 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
IFS="$OLDIFS"
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
if pathfind torsocks; then
|
|
||||||
exec torsocks "$@"
|
exec torsocks "$@"
|
||||||
echo "$0: Failed to exec torsocks $*" >&2
|
|
||||||
exit 1
|
|
||||||
else
|
else
|
||||||
echo "$0: torsocks not found in your PATH. Perhaps it isn't installed? (tsocks is no longer supported, for security reasons.)" >&2
|
echo "$0: torsocks not found in your PATH. Perhaps it isn't installed? (tsocks is no longer supported, for security reasons.)" >&2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user