Summary: Using the LSB Bootscripts

Bryan Kadzban bryan at kadzban.is-a-geek.net
Tue May 17 21:34:01 PDT 2011


Few nits related to the shell.  In the network script:

>             # Process individual configuration files
>             for file in `ls "${dir}"`; do

Ew.  :-)  How about:

for file in "${dir}"/* ; do
    ONBOOT=`grep "ONBOOT" "${file}" | sed ...
...

(since it always does a ${dir}/${file} as written)

In the ifup/ifdown scripts:

> else
>     grep "${INTERFACE}" /proc/net/dev 2>&1 > /dev/null
>     if [ "${?}" != "0" ]; then

Why not a (simpler):

if grep "${INTERFACE}" /proc/net/dev 2>&1 > /dev/null ; then

instead?  (This is done in several places: anywhere the script is
testing the value of "$?" can potentially be simplified.)

>         echo "ERROR: ${INTERFACE} is not a valid network interface."
>         echo ""
>         exit2

That should be "exit 2", right?  :-)

>     fi
> fi


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 261 bytes
Desc: OpenPGP digital signature
URL: <http://lists.linuxfromscratch.org/pipermail/lfs-dev/attachments/20110517/a14639f7/attachment.sig>


More information about the lfs-dev mailing list