Advertisement
Guest User

Untitled

a guest
Nov 26th, 2015
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Groovy 0.48 KB | None | 0 0
  1. // we will make a new config file here
  2. def newConfig = "";
  3.  
  4. def configFile = new File("../lib/config.cfg");
  5.  
  6. def config = configFile.text;
  7.  
  8. config.eachLine
  9. {
  10.     line->
  11.  
  12.     if(line.contains("collector.script.threadpool="))
  13.     {
  14.         def tokens = line.split("=");
  15.         newConfig += tokens.first() + "=" + (tokens.last().toInteger() + 5); // Add 5 to the threads.
  16.     }
  17.     else
  18.     {
  19.         newConfig += line + "\n";
  20.     }
  21. }
  22.  
  23. // newConfig is old one with line changed
  24.  
  25. configFile.write(newConfig);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement