mirror of
https://github.com/akuker/RASCSI.git
synced 2025-01-10 17:30:47 +00:00
More helpful error message when IP does not resolve for OLED screen (#541)
* More helpful error message * Remove confusing fallback IP * Tweak message
This commit is contained in:
parent
4ae273ccbd
commit
200bc7251f
@ -14,7 +14,7 @@ def get_ip_and_host():
|
||||
sock.connect(('10.255.255.255', 1))
|
||||
ip_addr = sock.getsockname()[0]
|
||||
except Exception:
|
||||
ip_addr = '127.0.0.1'
|
||||
ip_addr = False
|
||||
finally:
|
||||
sock.close()
|
||||
return ip_addr, host
|
||||
|
@ -161,7 +161,11 @@ def formatted_output():
|
||||
else:
|
||||
output.append("No image mounted!")
|
||||
|
||||
output.append(f"IP {IP_ADDR} - {HOSTNAME}")
|
||||
if IP_ADDR:
|
||||
output.append(f"IP {IP_ADDR} - {HOSTNAME}")
|
||||
else:
|
||||
output.append("RaSCSI has no IP address")
|
||||
output.append("Check network connection")
|
||||
return output
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user