[Opendnssec-develop] Be very very careful with bash && chains...

Jerry Lundström jerry at opendnssec.org
Fri Feb 7 14:47:19 UTC 2014


Hi,

Just want to remind all that you need to be careful with the && chains in bash, saw this:

if [ -n "$HAVE_MYSQL" ]; then
        ods_setup_conf conf.xml conf-mysql.xml
else
        ods_setup_conf conf.xml conf.xml
fi &&

case "$DISTRIBUTION" in
        freebsd )
                return 0
                ;;
esac

ods_reset_env &&

The && chain is broken by the case, since its not included then ods_reset_env and all the rest will run even if ods_setup_conf fails.

--
Jerry Lundström - OpenDNSSEC Developer
http://www.opendnssec.org/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 625 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.opendnssec.org/pipermail/opendnssec-develop/attachments/20140207/d611e832/attachment.bin>


More information about the Opendnssec-develop mailing list