All pastes #1543000 Raw Edit

clueless

public text v1 · immutable
#1543000 ·published 2009-08-26 10:13 UTC
rendered paste body
#!/bin/bash# just an example of how you could handle your downloads# try some pattern matching on the uri to determine what we should do# Some sites block the default wget --user-agent..dest="$HOME/Downloads"que="$HOME/Downloads/.downloadque"url="$8"GET="wget --user-agent=Firefox"function processque {while [ `wc -l $que | awk '{print $1}'` -ge "1" ]do	cd "$dest"; eval "$GET  `head -1 $que`" 	echo `head -1 $que`	sed -i 1d $quedoneecho "Downloadque is empty"}#test "x$url" = "x" && { echo "Geen url opgegeven! Zal nu de downloadque behandelen! ($url)"; exit 1; }test "x$1" = "x" && { echo "No URL given! Will start processing downloadque now! ($1)"; processque; exit 1; }test "x$8" != "x" && { echo "($8) is added to downloadque"; echo "$8" >> "$que"; exit 1; }test "x$1" != "x" && { echo "($1) is added to downloadque"; echo "$1" >> "$que"; exit 1; }# only changes the dir for the $get sub process#if echo "$url" | grep -E '.*\.torrent' >/dev/null;#then#    ( cd "$dest"; eval "$GET" "$url")#else#    ( cd "$dest"; eval "$GET" "$url")#fi