summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Goulet <dgoulet@torproject.org>2023-08-14 15:09:09 +0000
committerDavid Goulet <dgoulet@torproject.org>2023-08-14 15:09:09 +0000
commit67bfb87dcbbdd7808446dc452f028b857701f2fc (patch)
tree1fcd5cedaab263327113312f60ea45d1f0acf30d
parent2c5c752fd2d671520789afb9f5cff6eb794c21c4 (diff)
parent9ae2f8a2293f7e2935b54f51b619ddafd716b070 (diff)
downloadtor-67bfb87dcbbdd7808446dc452f028b857701f2fc.tar.gz
tor-67bfb87dcbbdd7808446dc452f028b857701f2fc.zip
Merge branch 'main' into 'main'
Clean up torify See merge request tpo/core/tor!740
-rwxr-xr-xcontrib/client-tools/torify19
1 files changed, 1 insertions, 18 deletions
diff --git a/contrib/client-tools/torify b/contrib/client-tools/torify
index ac4c9b5c7f..94640c0faf 100755
--- a/contrib/client-tools/torify
+++ b/contrib/client-tools/torify
@@ -37,25 +37,8 @@ case $1 in -v|--verbose)
shift
esac
-# taken from Debian's Developer's Reference, 6.4
-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
+if command -v torsocks > /dev/null; then
exec torsocks "$@"
- echo "$0: Failed to exec torsocks $*" >&2
- exit 1
else
echo "$0: torsocks not found in your PATH. Perhaps it isn't installed? (tsocks is no longer supported, for security reasons.)" >&2
fi
-