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: pgp6yUOVMB9HU.pgp
Description: PGP signature

-- 
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux