Compare commits

..

2 Commits

Author SHA1 Message Date
infinisean
4c8f077b80
Update alpine-install.func
Fixed a mistake in prior commit
2024-11-24 18:13:21 -05:00
infinisean
a8f2884468
Fix unreliable IPv4 internet test in alpine-install.func
Added two additional public resolver IPs (8.8.8.8 & 9.9.9.9) from diverse ASNs so that if any of the three IPs are reachable, the test will succeed.
The only condition that should fail this test is if the configuration is incorrect, and there is no internet access at all... therefore, if even one of the test destinations responds, the container network configuration is correct and the test should succeed.

Three diverse autonomous systems is the minimum number of destinations that should be checked for a connectivity test like this.
More would be better, but three will do.   If ALL fail, the test fails. If ANY respond, the test should succeed. 
The more (and more diverse) destination ASNs checked, the lower the probability that the test returns a false "fail" due to network conditions (such as routing problems on the upstream ISP, packet loss, firewall blocks, etc.) other than incorrect container configuration, which is what this test is meant to validate.
2024-11-24 18:10:54 -05:00

View File

@ -78,7 +78,10 @@ setting_up_container() {
network_check() { network_check() {
set +e set +e
trap - ERR trap - ERR
if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then msg_ok "Internet Connected"; else if ping -c 1 -W 1 1.1.1.1 &>/dev/null || ping -c 1 -W 1 8.8.8.8 &>/dev/null || ping -c 1 -W 1 9.9.9.9 &>/dev/null; then
msg_ok "IPv4 Internet Connected";
ipv4_connected=true
else
msg_error "Internet NOT Connected" msg_error "Internet NOT Connected"
read -r -p "Would you like to continue anyway? <y/N> " prompt read -r -p "Would you like to continue anyway? <y/N> " prompt
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then