help-cfengine
[Top][All Lists]
Advanced

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

Setting an OS-specific class


From: Tod Oace
Subject: Setting an OS-specific class
Date: Tue, 21 Sep 2004 17:08:15 -0700

Well this was unexpected. The following:

control:
        actionsequence = ( shellcommands )

classes:
redhat:: someclass = ( ReturnsZero(/bin/egrep -q something /dev/null) )

alerts:
        redhat:: "I am running on redhat"
        someclass:: "someclass is active"
        solaris:: "I am running on solaris"


Produces the following output on Solaris:

/bin/egrep: illegal option -- q
usage: egrep [ -bchilnsv ] [ -e exp ] [ -f file ] [ strings ] [ file ] ...
cfengine:: I am running on solaris


I looked at the reference manual and it says that the "redhat::" is ANDed with the ReturnsZero, so I guess it's working the way it's supposed to, but it's what I expected. And I don't know how else to easily limit the egrep to redhat.

This is on 2.1.10. Any ideas?

--
Tod Oace, Intel Corporation <tod@intel.com>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]