Changeset 31107 for main


Ignore:
Timestamp:
2016-11-14T21:33:12+13:00 (7 years ago)
Author:
ak19
Message:

Fixing subtle and hard to track down mistake that had prevented rebuilding solr (demo) collection when using server machine's hostname instead of localhost on Windows. Previously the regex matching on IPv4 in ipconfig output would latch onto the last line that mentioned it, which was the IPv4 address of the ethernet. So the host IP still worked but not hostname when accessing the solr servlet. Now the regex forces the code to use the correct IPv4 address: the line that starts with IPv4 (which has 3 empty spaces in front of it) rather than any of the many other lines that merely contain the string IPv4 Address.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/bin/script/IPv4.bat

    r30038 r31107  
    44rem If passed -format-for-tomcat-context, it will echo the same with a pipe
    55rem symbol up front and all the . escaped with a "\". E.g. "|100\.200\.300\.45"
     6rem The 3 spaces in front of the IPv4 match expression ensure we grab the line
     7rem that starts with "IPv4 Address", not the many others containing "IPv4 Address".
     8rem Without the spaces, it will grab the last line mentioning "IPv4" (ethernet).
    69
    7 for /f "usebackq tokens=2 delims=:" %%a in (`ipconfig ^| find "IPv4"`) do (set result=%%a)
     10for /f "usebackq tokens=2 delims=:" %%a in (`ipconfig ^| find "   IPv4"`) do (set result=%%a)
    811
    912:: To lop off the single extra space in front of IPv4 number, end with:
Note: See TracChangeset for help on using the changeset viewer.