capture compile error and terminate bash script
I've written a bash script which install 3 packages from source. The
script is fairly simple with the ./configure, make, make install
statements written thrice (after cding into the source folder). To make it
look a little cleaner, I have redirected the output to another file like
so:./configure >> /usr/local/the_packages/install.log 2>&1.
The question is, if any one package fails to compile due to some reason
(I'm not even sure of what reason, because it has always run successfully
till now - this is just something I want to add), I'd like to terminated
the script and rollback.
I figure rolling back would simply be deleting the destination folders
specified in prefix=/install/path but how do I terminate the script
itself?
No comments:
Post a Comment