dakboard / Hardware-OS

DAKboard Wall Display, CPU, and Raspberry Pi
25 stars 4 forks source link

Provide for workaround for internet validation (ping) #87

Closed cocarrig closed 6 months ago

cocarrig commented 1 year ago

Description: For network validation, the DAKboard OS completes a ping request to validate internet access. Because some organizations block outbound ping requests there is a use case for the ability for the users with terminal access to change the destination ping address in one location as opposed to the current hardcoded multiple locations.

cocarrig commented 1 year ago

potential redesign methodology using netcat: nc -vz google.com 443

command success criteria: 'succeeded' is present in response

Dan-Peck commented 10 months ago

After some initial research, nc appears to never exit when there's a failed connection, and while we can specify the length of timeouts, there is no way to specify the number of retries!

However, there is a CLI unix utility called timeout that can kill a process after X amount of time. I've tested this and it works nicely! The exit status can be used to determine the success of the operation. If it is 0, then it was a successful test, anything else, and it is a connection failure.

cocarrig commented 6 months ago

Completed and released in version 4.01 for RPi models, will not be supported for OPi models at this time: https://github.com/dakboard/Hardware-OS/releases/tag/4.01