diff options
Diffstat (limited to 'examples')
-rwxr-xr-x | examples/scripts/download.sh | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/scripts/download.sh b/examples/scripts/download.sh index 41c408e..8078cc8 100755 --- a/examples/scripts/download.sh +++ b/examples/scripts/download.sh @@ -1,2 +1,12 @@ #!/bin/bash -wget $6 +# A bit more advanced, try some pattern matching on the link to determine +# a target location. pushd and popd might be better than plain cd... +if [[ $8 =~ .*(.torrent) ]] +then + pushd /your/place/for/torrent/files +else + pushd /your/place/for/usual/downloads +fi +# Some sites block the default wget --user-agent... +wget --user-agent=Firefox $8 +popd |