mirror of https://github.com/tteck/Proxmox.git
Add network tools (#467)
This commit is contained in:
parent
b21ce7b82e
commit
77f299cb05
|
@ -37,6 +37,10 @@ function msg_ok() {
|
||||||
local msg="$1"
|
local msg="$1"
|
||||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
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 "
|
msg_info "Setting up Container OS "
|
||||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||||
|
@ -54,6 +58,10 @@ done
|
||||||
msg_ok "Set up Container OS"
|
msg_ok "Set up Container OS"
|
||||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||||
|
|
||||||
|
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; fi;
|
||||||
|
RESOLVEDIP=$(nslookup "google.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
|
||||||
|
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved to $RESOLVEDIP"; fi;
|
||||||
|
|
||||||
msg_info "Updating Container OS"
|
msg_info "Updating Container OS"
|
||||||
apt-get update &>/dev/null
|
apt-get update &>/dev/null
|
||||||
apt-get -y upgrade &>/dev/null
|
apt-get -y upgrade &>/dev/null
|
||||||
|
|
|
@ -38,6 +38,11 @@ function msg_ok() {
|
||||||
echo -e "${BFR} ${CM} ${GN}${msg}${CL}"
|
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 "
|
msg_info "Setting up Container OS "
|
||||||
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen
|
||||||
locale-gen >/dev/null
|
locale-gen >/dev/null
|
||||||
|
@ -54,6 +59,10 @@ done
|
||||||
msg_ok "Set up Container OS"
|
msg_ok "Set up Container OS"
|
||||||
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
msg_ok "Network Connected: ${BL}$(hostname -I)"
|
||||||
|
|
||||||
|
if nc -zw1 8.8.8.8 443; then msg_ok "Internet Connected"; else msg_error "Internet NOT Connected"; fi;
|
||||||
|
RESOLVEDIP=$(nslookup "google.com" | awk -F':' '/^Address: / { matched = 1 } matched { print $2}' | xargs)
|
||||||
|
if [[ -z "$RESOLVEDIP" ]]; then msg_error "DNS Lookup Failure"; else msg_ok "DNS Resolved to $RESOLVEDIP"; fi;
|
||||||
|
|
||||||
msg_info "Updating Container OS"
|
msg_info "Updating Container OS"
|
||||||
apt-get update &>/dev/null
|
apt-get update &>/dev/null
|
||||||
apt-get -y upgrade &>/dev/null
|
apt-get -y upgrade &>/dev/null
|
||||||
|
|
Loading…
Reference in New Issue