All of lore.kernel.org
 help / color / mirror / Atom feed
From: MARG <lists@tuxdoit.com>
To: linux-admin@vger.kernel.org
Subject: Question about exception
Date: Sun, 11 Dec 2005 22:58:45 +0000	[thread overview]
Message-ID: <439CAF25.5030704@tuxdoit.com> (raw)

Hi,

I'm making this BASH script to install a ful web system in Linux:

-----------------------------------------------------------
#!/bin/bash

#
# Uncompress and pre-configure Apache
#
file="apache_1.3.34.tar.gz"

if [ ! -f "$file" ] ;
 then
  echo "file '$file' not found" >&2
 exit 1
fi

tar -zxpvf $file
base_apache="${file%.tar.gz}"
cd $base_apache
./configure --prefix=/usr/local/httpd
cd ..

#
# Install MySQL
#
file="mysql-5.0.15.tar.gz"

if [ ! -f "$file" ] ;
 then
  echo "file '$file' not found" >&2
 exit 1
fi

tar -zxpvf $file
base_mysql="${file%.tar.gz}"
cd $base_mysql
./configure --prefix=/usr/local/mysql || make || make install
cd ..


#
# Install PostgreSQL
#
file="postgresql-8.1.0.bz2"

if [ ! -f "$file" ] ;
 then
  echo "file '$file' not found" >&2
 exit 1
fi

# and so forth...
-----------------------------------------------------------

I'd like to abort the whole script, if some package compile aborts with
an error.
For example, if there is an error compiling MySQL, i don't want the
script to follow to PostgreSQL.
I want it to abort with an error.

How can i do this ?

Any help would be apreciated.

Warm regards,
MARG

             reply	other threads:[~2005-12-11 22:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-11 22:58 MARG [this message]
2005-12-12  1:06 ` Question about exception Glynn Clements
2005-12-12 17:56 ` Jeff Woods

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=439CAF25.5030704@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.