|
|
|
@ -38,23 +38,32 @@ function msg_ok() {
|
|
|
|
|
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function msg_error() {
|
|
|
|
|
local msg="$1"
|
|
|
|
|
echo -e "${BFR} ${CROSS} ${RD}${msg}${CL}"
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
msg_info "Setting up Container OS "
|
|
|
|
|
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
|
|
|
|
locale-gen >/dev/null
|
|
|
|
|
while [ "$(hostname -I)" = "" ]; do
|
|
|
|
|
1>&2 echo -en "${CROSS}${RD} No Network! "
|
|
|
|
|
1>&2 echo -en "${CROSS}${RD} No Network! "
|
|
|
|
|
sleep $RETRY_EVERY
|
|
|
|
|
((NUM--))
|
|
|
|
|
if [ $NUM -eq 0 ]
|
|
|
|
|
then
|
|
|
|
|
1>&2 echo -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
|
|
|
|
|
1>&2 echo -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
done
|
|
|
|
|
msg_ok "Set up Container OS"
|
|
|
|
|
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
|
|
|
|
|
|
|
|
|
msg_info "Updating Container OS (216 packages)"
|
|
|
|
|
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; exit 1; fi;
|
|
|
|
|
RESOLVEDIP=$(nslookup "github.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
|
|
|
|
|
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved github.com to $RESOLVEDIP"; fi;
|
|
|
|
|
|
|
|
|
|
msg_info "Updating Container OS"
|
|
|
|
|
apt-get update &>/dev/null
|
|
|
|
|
apt-get -y upgrade &>/dev/null
|
|
|
|
|
msg_ok "Updated Container OS"
|
|
|
|
|