@ -78,22 +78,51 @@ 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
msg_error "Internet NOT Connected"
while true; do
read -r -p "Would you like to continue anyway? <y/N> " prompt
if ping -c 1 -W 1 1.1.1.1 &>/dev/null; then
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
msg_ok "Internet Connected"
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
break
else
else
echo -e " 🖧 Check Network Settings"
msg_error "Internet NOT Connected"
exit 1
echo "Choose an option:"
echo "1) Continue without internet"
echo "2) Retest for internet connection"
echo "3) Abort"
read -r -p "Enter your choice (1/2/3): " choice
case $choice in
1)
echo -e " ⚠️ ${RD}Expect Issues Without Internet${CL}"
break
;;
2)
echo "Retesting internet connection..."
continue
;;
3)
echo -e " 🖧 Check Network Settings"
exit 1
;;
*)
echo "Invalid option. Please enter 1, 2, or 3."
;;
esac
fi
fi
fi
done
RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
RESOLVEDIP=$(getent hosts github.com | awk '{ print $1 }')
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"; fi
if [[ -z "$RESOLVEDIP" ]]; then
msg_error "DNS Lookup Failure"
else
msg_ok "DNS Resolved github.com to ${BL}$RESOLVEDIP${CL}"
fi
set -e
set -e
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
trap 'error_handler $LINENO "$BASH_COMMAND"' ERR
}
}
update_os() {
update_os() {
msg_info "Updating Container OS"
msg_info "Updating Container OS"
$STD apk update
$STD apk update