[OpenSIPS-Users] opensipsctl erros

Vadim Grinco vadim at grinco.eu
Fri Apr 30 17:07:04 CEST 2010


Hi,

On Fri, Apr 30, 2010 at 4:32 PM, brianpocock <briankeithjames at googlemail.com
> wrote:

>
> Just checked my configuration and it works fine for me with:
> if [ $DBENGINE -eq "MYSQL" ]
> when doing opensipsctl alias_db list/show
>
> Not sure whether you made a typo with:
> if [ $DBENGINE -eq "MYSQL" ]
> if [ $DBENGINE -eq "PGSQL" ]
>
> but it should read:
> if [ $DBENGINE -eq "MYSQL" ]
> elif [ $DBENGINE -eq "PGSQL" ]
>
> I don't see any substantial difference between if and elif in this
situation. Yes, it will save you a couple of milliseconds to execute because
it won't do the second comparison, but the logyc is the same.
In this case the operator is incorrect. If you man sh, you will see that -eq
is an arithmetic binary operator, but = or == is used to compare strings.

You might have an interpreter which will understand both versions, but don't
forget there're lots of them out there.



> Hope this helps
> --
> View this message in context:
> http://opensips-open-sip-server.1449251.n2.nabble.com/opensipsctl-erros-tp4985896p4985961.html
> Sent from the OpenSIPS - Users mailing list archive at Nabble.com.
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



-- 
Best regards,
Vadim Grinco
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.opensips.org/pipermail/users/attachments/20100430/c1c3b02a/attachment.htm 


More information about the Users mailing list