All of lore.kernel.org
 help / color / mirror / Atom feed
From: MARG <lists@tuxdoit.com>
To: linux-admin@vger.kernel.org
Subject: Is there a better way
Date: Mon, 12 Dec 2005 20:03:27 +0000	[thread overview]
Message-ID: <439DD78F.80606@tuxdoit.com> (raw)

Hi,

I'm doing this script (after my signature) that starts by downloading
files from the web.
It checks for each file if the download was successful.

Is theres a fancier way to do the test, instead of repeating
-----------------------------------
code=$?
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
-----------------------------------

for each file ?

Any help would be apreciated.

Warm Regards,
MARG

#!/bin/bash

cd /usr/local/src
wget
http://www.mirror.ac.uk/mirror/ftp.apache.org/httpd/apache_1.3.34.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget
http://www.mirror.ac.uk/mirror/www.mysql.org/Downloads/MySQL-5.0/mysql-5.0.16.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget
http://www.mirror.ac.uk/mirror/ftp.postgresql.org/v8.1.1/postgresql-8.1.1.tar.bz2
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget
http://www.mirror.ac.uk/mirror/ftp.openssl.org/source/openssl-0.9.8a.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget
http://www.mirror.ac.uk/mirror/ftp.modssl.org/source/mod_ssl-2.8.25-1.3.34.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget http://www.mirror.ac.uk/mirror/ftp.apache.org/perl/mod_perl-1.29.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget http://www.modsecurity.org/download/modsecurity-apache-1.9.1.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget
http://puzzle.dl.sourceforge.net/sourceforge/mcrypt/libmcrypt-2.5.7.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget http://puzzle.dl.sourceforge.net/sourceforge/mhash/mhash-0.9.3.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget http://puzzle.dl.sourceforge.net/sourceforge/mcrypt/mcrypt-2.6.4.tar.gz
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget
http://www.mirror.ac.uk/mirror/rsync.php.net/distributions/php-5.1.1.tar.bz2
code=$?
echo $code
if [ $code != 0 ]
 then
  echo "Couldn't retrieve file :("
  exit 1
fi
wget http://neacm.fe.up.pt/pub/apache/httpd/modpython/mod_python-2.7.11.tgz

             reply	other threads:[~2005-12-12 20:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-12 20:03 MARG [this message]
2005-12-12 20:25 ` Is there a better way Scott Taylor
2005-12-12 20:36 ` Adrian C.
2005-12-12 21:01   ` Scott Taylor
2005-12-12 21:09     ` Adrian C.

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=439DD78F.80606@tuxdoit.com \
    --to=lists@tuxdoit.com \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.