#!/bin/sh
# wget must be in your path
LANGCODE=$1
echo 'language code is: ' + $LANGCODE
DUMPDIR=dumps/
cd $DUMPDIR
pwd

if hash wget 2>/dev/null; 
then   
  WGET=wget
elif hash /opt/local/bin/wget 2>/dev/null; 
then   
  WGET=/opt/local/bin/wget
else
  exit
fi

WGETCMD="$WGET http://download.wikimedia.org/"$LANGCODE"wiki/latest/"$LANGCODE"wiki-latest-pages-articles.xml.bz2"

echo $WGETCMD
$WGETCMD

