Update install.func

The script now checks for both IPv4 and IPv6 Internet connectivity and displays the results. Only if both IPv4 and IPv6 checks fail, it will then prompt the user.
pull/2532/head
tteckster 1 year ago committed by GitHub
parent c0e3edc0c9
commit 71ca43c7a2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -112,35 +112,33 @@ setting_up_container() {
network_check() { network_check() {
set +e set +e
trap - ERR trap - ERR
# Check if IPv4 is being used ipv4_connected=false
if ip -o -4 addr show | grep -q "scope global"; then ipv6_connected=false
if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then
msg_ok "IPv4 Internet Connected"; # Check IPv4 connectivity
else if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then
msg_error "IPv4 Internet Not Connected"; msg_ok "IPv4 Internet Connected";
read -r -p "Would you like to continue anyway? <y/N> " prompt ipv4_connected=true
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then else
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}" msg_error "IPv4 Internet Not Connected";
else fi
echo -e " 🖧 Check Network Settings"
exit 1 # Check IPv6 connectivity
fi if ping6 -c 1 -W 1 2606:4700:4700::1111 &>/dev/null; then
fi msg_ok "IPv6 Internet Connected";
ipv6_connected=true
else
msg_error "IPv6 Internet Not Connected";
fi fi
# Check if IPv6 is being used # If both IPv4 and IPv6 checks fail, prompt the user
if ip -o -6 addr show | grep -q "scope global"; then if [[ $ipv4_connected == false && $ipv6_connected == false ]]; then
if ping -6 google.com &>/dev/null; then read -r -p "No Internet detected,would you like to continue anyway? <y/N> " prompt
msg_ok "IPv6 Internet Connected"; if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
else else
msg_error "IPv6 Internet Not Connected"; echo -e " 🖧 Check Network Settings"
read -r -p "Would you like to continue anyway? <y/N> " prompt exit 1
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
else
echo -e " 🖧 Check Network Settings"
exit 1
fi
fi fi
fi fi

Loading…
Cancel
Save

Powered by BW's shoe-string budget.