Forum: Cfengine Help
Subject: Re: Insert a block of text
Author: pieterb
Link to topic: https://cfengine.com/forum/read.php?3,17019,17030#msg-17030

My current code is exactly like this; as you can see there are no double quotes 
to escape, this cannot be the problem.

The block of text gets inserted correctly; but when I remove one line from the 
block in the a.txt file; it inserts only that line again at the end of the 
document. I want it to either keep the whole block in tact, or reinsert the 
complete block again. CUPS will not recognize the printer definition if it is 
uncomplete.


  "lines1" string => "
Info Brother HL-5350DN BR-Script3
MakeModel Brother HL-5350DN BR-Script3
State Idle
Filter application/vnd.cups-raw 0 -
Filter application/vnd.cups-command 0 commandtops
Filter application/vnd.cups-postscript 0 -
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Attribute marker-colors \#000000,#000000,#000000
Attribute marker-levels -1,-1,95
Attribute marker-names Black Toner Cartridge,Black Toner Cartridge,Drum Unit
Attribute marker-types toner,toner,opc
Attribute marker-change-time 1268735525
";

files:
  "/var/test/a.txt"
            create => "true",
         edit_line => append_if_no_line("$(insert.lines1)");
}

bundle edit_line append_if_no_line(str)
{
insert_lines:
 "$(str)"
     insert_type => "literal";




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

Reply via email to