Antonio Olivares wrote: > --- On Tue, 7/8/08, Tim <[EMAIL PROTECTED]> wrote: >>> [EMAIL PROTECTED] 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
pgp11kxBA7eUj.pgp
Description: PGP signature
-- fedora-list mailing list [email protected] To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
