help-cfengine
[Top][All Lists]
Advanced

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

script exit code


From: Sabrina Lautier
Subject: script exit code
Date: Wed, 21 Aug 2002 16:58:33 +0200

Hi !

I would like my cfengine script to return an error (ie, a positive 
value) if some conditions are not fulfilled.

Something like that:
---------------------
!class1.!class2::
  <exit 1>
---------------------

Is there a way to do that ?
I've glanced through the cfengine reference guide but haven't found 
anything which could help me.

The reason for that is that I wrote a cfengine module which create a 
cfengine script. This script should return 1 if a file copy didn't 
occur (file not found in the expected directory).
>From the tests I made, cfengine doesn't return an error if we try to 
copy a file which doesn't exist on the server side:
-------------------------------------------
copy:
  $(master_dir)  dest=$(client_work_dir)
                 r=1
                 include=toto
                 server=$(cfserver)
-------------------------------------------
If toto does not exist on the server, cfengine doesn't return 1.
I can of course add a define option (define=file_copied) which will 
tell if the file has been copied but how to return 1 to the module if 
there was no copy ?

Thanks for any help.

Sabrina

---------------------------------------------
Powered by Alinto (http://www.alinto.net)
        for lavache.com (http://www.lavacheautomatique.com)




reply via email to

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