Duh! That worked.
I wrote a vbscript that runs in Windows that will toggle that "once = 1" flag like so
once = 1 to --once = 1
and
--once = 1 to once = 1
It expects multi-core client setups with the following folder structure
Example:
C:\dcprojects\llrnet (can be anywhere) This is where the vbscript goes - I called it Toggle_Work.vbs
Inside that directory, it expects to see the following directory names, all starting with llrnet - for multi-core setups.
llrnet1
llrnet2
llrnet3
...
llrnet8
It will edit each llr-clientconfig.txt in each directory that starts with LLRNET (case not sensitive)
If you used some other directory name, change the code where it shows LLRNET to whatever you used
In the below code, look for: strFolder = objShell.CurrentDirectory & "\LLRNET" & count & "\"
or, rename your directories
If you have more than 8 cores, say 16, look in the code for
For count = 1 to 8
and change it to
For count = 1 to 16
Give it a go and let me know what you think.
Because the forum 'code' tag screws stuff up, I'll place the vbscript code in php tags
FileName: Toggle_Work.vbs
PHP Code:
'Option Explicit
Const ForReading = 1
Const ForWriting = 2
Dim objShell, objFSO, objFile, FileName, count, strFolder, strLine, strNewText, strFlag
Set objShell = CreateObject("Wscript.Shell")
FileName = "llr-clientconfig.txt"
pcengine = LCase(Mid(WScript.FullName, InstrRev(WScript.FullName,"\")+1))
If Not pcengine="cscript.exe" Then
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "CSCRIPT.EXE """ & WScript.ScriptFullName & """"
WScript.Quit(1)
End If
WScript.Echo vbCrLf
On Error Resume Next
For count = 1 to 8
strFolder = objShell.CurrentDirectory & "\LLRNET" & count & "\"
Set objFSO = createobject("Scripting.FileSystemObject")
If objFSO.FolderExists(strFolder) then
Set objFile = objFSO.OpenTextFile(strFolder & FileName, ForReading)
Do Until objFile.AtEndOfStream
strLine = Trim(objFile.ReadLine)
If InStr(1, strLine, "once", 1) Then
If strFlag = "" Then
strLine = Replace(strLine, " ", "")
If Left(strLine, 2) = "--" Then
strLine = "once = 1"
strFlag = "once = 1"
Else
strLine = "--once = 1"
strFlag = "--once = 1"
End If
Else
strLine = strFlag
End If
Else
End If
strNewText = strNewText & strLine & vbCrLf
Loop
objFile.Close
If strNewText = "" Then
WScript.Echo "There is a problem with " & FileName & " aborting!"
Exit For
End If
arrLines = Split(strNewText, vbCrLf)
Set objFile = objFSO.OpenTextFile(strFolder & FileName, ForWriting)
For i = 0 to UBound(arrLines) - 1
objFile.WriteLine arrLines(i)
Next
objFile.Close
WScript.Echo "llrnet" & count & " changed to " & strFlag
strFolder = ""
objFSO = ""
objFile = ""
strLine = ""
strNewText = ""
arrLines = ""
Else
End If
Next
WScript.Echo VbCrLf & "Sleeping for 5 seconds..." & vbCrLf
WScript.Sleep(5000)
Enjoy