Pass proxy_url to download handler
[uzbl-mobile] / examples / data / uzbl / scripts / download.sh
1 #!/bin/sh
2 # just an example of how you could handle your downloads
3 # try some pattern matching on the uri to determine what we should do
4
5 # Some sites block the default wget --user-agent..
6 GET="wget --user-agent=Firefox"
7
8 dest="$HOME"
9 url="$8"
10
11 http_proxy="$9"
12 export http_proxy
13
14 test "x$url" = "x" && { echo "you must supply a url! ($url)"; exit 1; }
15
16 # only changes the dir for the $get sub process
17 if echo "$url" | grep -E '.*\.torrent' >/dev/null;
18 then
19     ( cd "$dest"; eval "$GET" "$url")
20 else
21     ( cd "$dest"; eval "$GET" "$url")
22 fi