Re: sendmail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Antonio Olivares wrote:
> --- On Tue, 7/8/08, Tim <ignored_mailbox@xxxxxxxxxxxx> wrote:
>>> [root@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: www.pobox.com/~tmz/pgp
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Attachment: pgpFjBXvH0Gs0.pgp
Description: PGP signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux