summaryrefslogtreecommitdiffstats
path: root/config/chroot_local-hooks/70-wget
blob: c10cc8090333fd015cf26aa339944c1efce68890 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh
set -e

# We don't want the real binary to be in $PATH:
# Also note that wget uses the executable name in some help/error messages,
# so wget-real/etc. should be avoided.
mkdir -p /usr/lib/wget
dpkg-divert --add --rename --divert /usr/lib/wget/wget /usr/bin/wget

# We don't want users or other applications using wget directly:
cat > /usr/bin/wget << 'EOF'
#!/bin/sh
unset http_proxy
unset HTTP_PROXY
unset https_proxy
unset HTTPS_PROXY

exec torsocks /usr/lib/wget/wget --passive-ftp "$@"
EOF

chmod 755 /usr/bin/wget