[wpkg-users] WPKG over multiple sites using local storage

Troy Hamilton troy.a.hamilton at gmail.com
Tue Aug 16 19:44:22 CEST 2011


>
>
> 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?
>

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.

wpkg.bat:
--------------------------------------------------------------------------------
@echo off
:: This is a recommended way of starting WPKG.

:: Use WPKGROOT variable to define where wpkg.js script is.

:: Use PACKAGES variable to define where all your software/installers are.
:: You can later use the PACKAGES variable (and all other variables) in your
xml files.

set WPKGROOT=%~dp0
CALL "%~dp0setServer.bat"
set SOFTWARE=\\%SERVER%\software

IF NOT EXIST %SOFTWARE% EXIT /B 1

c:\windows\system32\cscript.exe //nologo /E:JScript %WPKGROOT%\wpkg.js
/synchronize /noremove /quiet /nonotify /sendStatus

--------------------------------------------------------------------------------

setServer.bat
--------------------------------------------------------------------------------
@echo off

set gw=0.0.0.0
FOR /F "tokens=13 delims= " %%i IN ('c:\windows\system32\ipconfig.exe ^|
find /i "default gateway"') DO CALL :SETGW %%i
IF {%gw%}=={0.0.0.0} GOTO :EOF

CALL :SETSVR

GOTO :EOF

:SETGW
SET tmpgw=%1
IF {%tmpgw:~0,3%}=={199} set gw=%tmpgw%
GOTO :EOF

:SETSVR
IF {%gw%}=={192.168.101.1} SET server=SERVER101
IF {%gw%}=={192.168.102.1} SET server=SERVER102
IF {%gw%}=={192.168.103.1} SET server=SERVER103
GOTO :EOF
--------------------------------------------------------------------------------

This method works pretty well for me.


Cheers,

Troy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20110816/b5413c91/attachment-0002.html>


More information about the wpkg-users mailing list