Ping to default gateways (per network) to see if local connection is … #1339
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
…alive.
This helps to distinguish between the case that pi does not have connection to the phone,
and the case that connection to the phone exists but phone has no external IP connection.
Also in the case that both WiFi and BT tethering is enabled one can see which of them is used (the one with the lower metric).
Here is an example to the output (when both WiFi and BT are enabled.):
At Mon 23 Dec 2019 04:50:08 PM IST my local Bluetooth IP is: 192.168.44.226
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 0) passed
At Mon 23 Dec 2019 04:50:10 PM IST ping to default gateway 192.168.44.1 (bnep0 metric = 214) passed
At Mon 23 Dec 2019 04:50:11 PM IST ping to default gateway 192.168.3.1 (wlan0 metric = 302) passed
At Mon 23 Dec 2019 04:50:11 PM IST my public IP is: 37.26.149.235
Signed-off-by: Tzachi Dar tzachi.dar@gmail.com