Changeset 32664

Show
Ignore:
Timestamp:
07.12.2018 18:17:09 (7 days ago)
Author:
ak19
Message:

On Kathy's machine, there is no eth0, as the default ethernet device has a different name, so doing ifconfig eth0 to get IPv4 address doesn't work. But on her machine, the older code that did just ifconfig to get the IPv4 does work, so using this method as a fallback.

Files:
1 modified

Legend:

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

    r32463 r32664  
    1818# As below: if $tmp is empty, can just return |, as that doesn't really matter. Will be consistent with windows 
    1919if [[ $tmp = *"Device not found"* ]] || [[ -z "${tmp// }" ]]; then 
    20     echo "|" 
     20    # eth0 is not found on Kathy's machine where the default ethernet device has a different name 
     21    # But ifconfig on its own works there, so try that next 
     22    tmp=`ifconfig 2>&1 | grep "inet " | grep -v 127.0.0.1` 
     23    if [[ $tmp = *"Device not found"* ]] || [[ -z "${tmp// }" ]]; then 
     24    echo "|" 
     25    fi 
    2126fi 
    2227