Here it is.  I think I am starting to see the problem with this.  I don't have 
a lot of shell scripting experience, and I think the script I sent out 
previously is not exactly a shell script.

bundle agent install_xinstall
{
  classes:
    "xinstall_exists" expression => fileexists("/usr/local/src/xinstall");
  commands:
    !xinstall_exists::
        "<this is where I would put my command from below>";
}

-----Original Message-----
From: Aleksey Tsalolikhin [mailto:atsaloli.t...@gmail.com] 
Sent: Monday, May 23, 2011 4:57 PM
To: Scott Dobner
Cc: help-cfengine@cfengine.org
Subject: Re: Lengthy in-line bash commands

Hi, Scott. Can you show us your Cfengine policy version of this script?

What your script is trying to accomplish?  What does the ideal system look 
like?  In other words, what is the desired end state of the system? Then 
instead of having Cfengine run your shell script as a commands type promise, we 
could  translate your shell script to native Cfengine promises.

Yours,
-at


On Mon, May 23, 2011 at 10:46 AM, Scott Dobner <scott.dob...@sas.com> wrote:
> Here is a sample of the bash script I am porting.  CFengine does not like the 
> syntax of using the conditional statements (which I have replaced through 
> classes), but I need to be able to check things in and out of cvs and cd into 
> that directory so that I can build the files correctly.  My goal was to avoid 
> having to have a script to install each piece of software that required this 
> sort of build, but it looks like that is what I might have to do.
>
>  if [ ! -d /usr/local/src ]; then                               \
>          mkdir -p /usr/local/src;                                     
> \
>        fi
>        @echo "--------------------> Building xinstall ...";           
> \
>          (cd /usr/local/src &&                                        
> \
>          export CVSROOT=:ext:cvs_repository && \
>          if [ -d xinstall ]; then                                     
> \
>            (cd xinstall && cvs update -d -P);                         
> \
>          else                                                         
> \
>            cvs co xinstall;                                           
> \
>          fi;                                                          
> \
>          cd xinstall && make all && make install)
>        touch $@
>
> -----Original Message-----
> From: help-cfengine-boun...@cfengine.org 
> [mailto:help-cfengine-boun...@cfengine.org] On Behalf Of Erlend 
> Leganger
> Sent: Monday, May 23, 2011 1:12 PM
> To: help-cfengine@cfengine.org
> Subject: Re: Lengthy in-line bash commands
>
> Give us more to work with: Provide an example of a "lengthy piece"
> that you want cf3 to execute; what did your command promise look like and 
> what was the error message etc.
>
> - Erlend
>
> On 23 May 2011 16:25, Scott Dobner <scott.dob...@sas.com> wrote:
>> Hi,
>> I am porting some bash scripts into cfengine and am having trouble 
>> with some lengthy pieces that I would like to execute as a command 
>> promise.  However, cfengine does not seem to agree with that.  I am 
>> trying to avoid creating individual shell scripts and would just like 
>> to run the command through cfengine.  Suggestions on how to do this would be 
>> greatly appreciated!
>>
>> Thanks,
>> Scott
>>
>> _______________________________________________
>> Help-cfengine mailing list
>> Help-cfengine@cfengine.org
>> https://cfengine.org/mailman/listinfo/help-cfengine
>>
>>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>


_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to