Todd Zullinger tmz at
Wed Jul 9 21:06:55 UTC 2008

Antonio Olivares wrote:
> --- On Tue, 7/8/08, Tim <ignored_mailbox at> wrote:
>>> [root at localhost Documents]# ./sendmail-script 

>>> ./sendmail-script: line 14: [: ==: unary operator expected
>>> ./sendmail-script: line 26: [: ==: unary operator expected
>> Show us the script that you're using.  But the problem's most
>> likely down to you expecting to run stand-alone.

This is because you're running the script without any arguments.
Lines 14 and 26 both test the second argument as a string, like:

[ $2 == "up" ]

Since you provided no second argument, $2 is empty and you've
basically done this:

[ == "up" ]

Which causes the error.  You can make the script more robust by
quoting the $2 in the tests:

[ "$2" == "up" ]

That will only prevent the bash error, not make the script do anything
when run without the proper arguments.  IIRC, NetworkManager scripts
are called with 2 arguments, the interface (e.g. eth0 or wlan0) and
it's status (e.g. up or down).

Todd        OpenPGP -> KeyID: 0xBEAF0CE3 | URL:
Does it follow that I reject all authority? Perish the thought. In the
matter of boots, I defer to the authority of the boot-maker.
    -- Mikhail Bakunin

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 542 bytes
Desc: not available
URL: <>

More information about the fedora-list mailing list