<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><br></div><div>I'm looking at how's best to setup multiple WAN locations with our WPKG server. We currently have a WPKG server in London and are setting up an office in Europe. The two sites will be VPN'd together fine and the WPKG server will work fine over the WAN, but is there a way to ease the file transfer by having another server in the second office just to store the files/software to update to reduce the amount of traffic between the two offices?</div>
</blockquote><div><br></div><div>I use this kind of setup within my organization.  I keep wpkg.bat on the NETLOGON share of each domain controller, but it could also be kept on a single server in the main office.  Then, I have wpkg.bat call setServer.bat which sets the %SOFTWARE% environment variable to the correct local server so that installers aren't pulled from across the WAN.</div>
<div><br></div><div>wpkg.bat:</div><div><div>--------------------------------------------------------------------------------</div><div>@echo off</div><div>:: This is a recommended way of starting WPKG.</div><div><br></div>
<div>:: Use WPKGROOT variable to define where wpkg.js script is.</div><div><br></div><div>:: Use PACKAGES variable to define where all your software/installers are.</div><div>:: You can later use the PACKAGES variable (and all other variables) in your xml files.</div>
<div><br></div><div>set WPKGROOT=%~dp0</div><div>CALL "%~dp0setServer.bat"</div><div>set SOFTWARE=\\%SERVER%\software</div><div><br></div><div>IF NOT EXIST %SOFTWARE% EXIT /B 1</div><div><br></div><div>c:\windows\system32\cscript.exe //nologo /E:JScript %WPKGROOT%\wpkg.js /synchronize /noremove /quiet /nonotify /sendStatus</div>
<div><br></div><div>--------------------------------------------------------------------------------</div></div><div><br></div><div>setServer.bat</div><div><div>--------------------------------------------------------------------------------</div>
<div>@echo off</div><div><br></div><div>set gw=0.0.0.0</div><div>FOR /F "tokens=13 delims= " %%i IN ('c:\windows\system32\ipconfig.exe ^| find /i "default gateway"') DO CALL :SETGW %%i</div><div>
IF {%gw%}=={0.0.0.0} GOTO :EOF</div><div><br></div><div>CALL :SETSVR</div><div><br></div><div>GOTO :EOF</div><div><br></div><div>:SETGW</div><div>SET tmpgw=%1</div><div>IF {%tmpgw:~0,3%}=={199} set gw=%tmpgw%</div><div>GOTO :EOF</div>
<div><br></div><div>:SETSVR</div><div>IF {%gw%}=={192.168.101.1} SET server=SERVER101</div><div>IF {%gw%}=={192.168.102.1} SET server=SERVER102</div><div>IF {%gw%}=={192.168.103.1} SET server=SERVER103</div><div>GOTO :EOF</div>
<div>--------------------------------------------------------------------------------</div></div><div><br></div><div>This method works pretty well for me.</div><div><br></div><div><br></div><div>Cheers,</div><div><br></div>
<div>Troy</div><div><br></div></div>