23 Dec

Metalink wget download script

Looking for a simpler way to download from the new Metalink?  Oracle has replaced the ftp site with http downloads using wget.  If you’re looking for a simple way to use wget without all of that cutting-and-pasting from the web site, you can use a simple script like this:

#!/bin/bash
# Program:  download.sh
# Description:  Download Oracle patches from Metalink<!--more-->

PROGRAM=`basename $0`
USAGE="Usage:  $PROGRAM [ patch file ]"

[ $# -lt 1 ] &amp;&amp; echo $USAGE &amp;&amp; exit 1

patch=$1
username=$METAUSER
password=$METAPASS
URL="http://updates.oracle.com/Orion/Download/download_patch/$patch"

while [ -z $username ]; do
   echo -n "Enter metalink username: "
   read username
done

while [ -z $password ]; do
   echo -n "Enter metalink password: "
   stty -echo
   read password
   stty echo
done

wget --http-user=$username \
--http-password=$password \
--no-check-certificate  \
--output-document=$patch $URL

exit

It’s pretty basic, so you can add error checking or more sophisticated wget options as you like.  The only thing you need is the full name of the patch zip file and your Metalink credentials:

$ download.sh <zip file>;

You can export your Metalink username and password to the variables $METAUSER and $METAPASS, respectively, or the script will prompt you for both.

Let me know how this works for you, or if you have a better option – I’m sure there are plenty out there.

Related posts from the blog:

  1. 9 reasons why the new Metalink sucks
    I know I’m not alone, and I know I’m not the first to express displeasure, but let me...
  2. Disable Flash for Oracle Metalink
    If you want to improve certain aspects of Oracle’s new Flash-based Metalink, you can do so by disabling...
  3. Use Autoconfig for common system administrator tasks
    Use Autoconfig for common system administrator tasks Autoconfig is a wonderful tool that may be extended and customized...
  4. FNDCPASS doesn’t always use the SYSTEM password
    FNDCPASS does not check the system password when used to change an applications user account. We can check...
  5. 6 things to do after an Oracle Apps R12 install
    OK, so there are a ton of things to do right after a fresh R12 install.  And before...

No comments yet

Leave a Reply