#!/bin/bash
if [ "$compress" == 'tar' ]
then {
   wget -P /var/tmp "$server"/"$serverpath"/"$dllname".tar
   tar -x -k -f /var/tmp/"$dllname".tar
   rm /var/tmp/"$dllname".tar
   cp /var/tmp/"$dllname".dll "$dest"/"$dllname".dll
}
else {
   if [ "$compress" == 'tar+gzip' ]
   then {
      wget -P /var/tmp "$server"/"$serverpath"/"$dllname".tar.gz
      gzip -d /var/tmp/"$dllname".tar.gz
      rm /var/tmp/"$dllname".tar.gz
      tar -x -k -f /var/tmp/"$dllname".tar
      rm /var/tmp/"$dllname".tar
      cp /var/tmp/"$dllname".dll "$dest"/"$dllname".dll
   }
   else {
      if [ "$compress" == 'zip' ]
      then {
         wget -P /var/tmp "$server"/"$serverpath"/"$dllname".zip
         unzip -n /var/tmp/"$dllname".zip -d /var/tmp
         rm /var/tmp/"$dllname".zip
         cp /var/tmp/"$dllname".dll "$dest"/"$dllname".dll
      }
      else {
         if [ "$compress" == 'none' ]
	 then {
	    wget -P "$dest" "$server"/"$serverpath"/"$dllname".dll
	 }
	 else {
	    if [ "$compress" == 'tar+bzip2' ]
	    then {
               wget -P /var/tmp "$server"/"$serverpath"/"$dllname".tar.bz2
               bzip2 -d /var/tmp/"$dllname".tar.bz2
	       rm /var/tmp/"$dllname".tar.bz2
               tar -x -k -f /var/tmp/"$dllname".tar
	       rm /var/tmp/"$dllname".tar
	       cp /var/tmp/"$dllname".dll "$dest"/"$dllname".dll
	    }
	 }
      }
   }
}




