Hi Marco,

On 15.05.2012 09:45, Marco Gaiarin wrote:
If network 192.168.1.0/24 then SOFTWARE=\\192.168.1.x\wpkg\software
If network 192.168.2.0/24 then SOFTWARE=\\192.168.2.x\\wpkg\software

I'm a bit curious. How do you check network address with cmd? I've
googled around a bit, but...

Using recent WPKG version you don't have to match it via cmd.exe (although you could potentially using "ipconfig | findstr...").

But you could also define conditional variables in profiles.

<profiles>
<profile id="site1"
  <variable name="SOFTWARE" value="\\server1\wpkg\software">
    <condition>
      <check type="host" condition="ipaddress" value="^192\.\168\.1" />
    </condition>
  </variable>
  <variable name="SOFTWARE" value="\\server2\wpkg\software">
    <condition>
      <check type="host" condition="ipaddress" value="^192\.\168\.2" />
    </condition>
  </variable>
  ...
</profile>
</profiles>

NOTE: It's entirely untested, I have just put this XML sniplet together in my mind...

As you see the purpose is that the SOFTWARE variable is defined on a profile by WPKG. The variable is conditional and depends on the value of the IP address. If the IP address does not match, then the whole variable statement is ignored. Therefore only one of the SOFTWARE variables will be assigned.
You can also use regular expressions to match different ranges.

If you're going to use this, then please report if it works for you as I did not test it myself.


More details about extended host attribute matching for IP addresses:
<http://wpkg.org/Extended_host_attribute_matching#ipaddresses>

br,
Rainer
-------------------------------------------------------------------------
wpkg-users mailing list archives >> http://lists.wpkg.org/pipermail/wpkg-users/
_______________________________________________
wpkg-users mailing list
wpkg-users@lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users

Reply via email to