Click to See Complete Forum and Search --> : script idea > current scripting knowledge


optech
05-01-2001, 05:06 PM
i'm creating an install script for my LFS system...

what i need is for it to be able to tell if bzip is installed on the current linux partition... i have the actual INSTALL script finished, but i want the begninning of the script to go:

is bzip installed? <--- this line
yes: continue
no: install it.

the line i need will check linux for bzip.
how would i do this?

(and did i explain my situation properly?)

optech
05-01-2001, 05:14 PM
also, the output of this:


./configure --enable-static-link --prefix=$LFS/usr \
--bindir=$LFS/bin --disable-nls --with-curses &&
make &&
make install &&
cd $LFS/bin &&
ln -s bash sh


will say either "hey, it worked", or "there was a problem with -lcurses"...
if there's a problem, i want it to run this:



cd /usr/lib &&
ln -s libncurses.a libcurses.a

./configure --enable-static-link --prefix=$LFS/usr \
--bindir=$LFS/bin --disable-nls --with-curses &&
make &&
make install &&
cd $LFS/bin &&
ln -s bash sh


can someone show me a site or resource that will teach me how i can do stuff like this and maybe other sweet-*** tidbits of knowledge?

Energon
05-01-2001, 11:52 PM
I'm pretty sure this bash code will work:


BZIP=`which bzip2`
if [ "$BZIP" = "" ]; then
echo "bzip2 was not found!"
exit 1
else
echo "bzip2 was found!"
fi
exit 0


but I'd test it first...

optech
05-02-2001, 02:08 AM
perfect! thanks