-if which curl >/dev/null 2>&1 ; then
- DL="curl -o $DEST.new $SRC"
- ${quiet} && DL="$DL -s -S"
-elif which wget >/dev/null 2>&1 ; then
- DL="wget --no-timestamping -O $DEST.new $SRC"
- ${quiet} && DL="$DL -q"
-elif which lynx >/dev/null 2>&1 ; then
- DL="eval lynx -source $SRC >$DEST.new"
+if command -v curl >/dev/null 2>&1 ; then
+ ${quiet} && QUIET="-s -S"
+ dl ()
+ {
+ curl -o $DEST.new --user-agent "$USER_AGENT curl" $QUIET $SRC
+ }
+elif command -v wget >/dev/null 2>&1 ; then
+ ${quiet} && QUIET="-q"
+ dl ()
+ {
+ wget --no-timestamping -O $DEST.new --user-agent "$USER_AGENT wget" $QUIET $SRC
+ }
+elif command -v lynx >/dev/null 2>&1 ; then
+ dl ()
+ {
+ lynx -source -useragent="$USER_AGENT lynx" $SRC >$DEST.new
+ }