From 5a5afad573d651140cfcbd73757b886312208843 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 31 Aug 2022 05:20:58 -0400 Subject: [PATCH] Add Internet & DNS Check (#471) --- setup/adguard-install.sh | 13 +++++++++++-- setup/daemonsync-install.sh | 13 +++++++++++-- setup/dashy-install.sh | 13 +++++++++++-- setup/deconz-install.sh | 9 +++++++++ setup/docker-install.sh | 13 +++++++++++-- setup/emby-install.sh | 13 +++++++++++-- setup/esphome-install.sh | 13 +++++++++++-- setup/grafana-install.sh | 13 +++++++++++-- setup/grocy-install.sh | 9 +++++++++ setup/heimdalldashboard-install.sh | 13 +++++++++++-- setup/homeassistant-install.sh | 13 +++++++++++-- setup/homebridge-install.sh | 13 +++++++++++-- setup/influxdb-install.sh | 13 +++++++++++-- setup/iobroker-install.sh | 13 +++++++++++-- setup/jellyfin-install.sh | 13 +++++++++++-- setup/keycloak-install.sh | 9 +++++++++ setup/magicmirror-install.sh | 9 +++++++++ setup/mariadb-install.sh | 13 +++++++++++-- setup/meshcentral-install.sh | 13 +++++++++++-- setup/motioneye-install.sh | 13 +++++++++++-- setup/mqtt-install.sh | 13 +++++++++++-- setup/n8n-install.sh | 13 +++++++++++-- setup/nginx-proxy-manager-install.sh | 13 +++++++++++-- setup/nocodb-install.sh | 13 +++++++++++-- setup/node-red-install.sh | 13 +++++++++++-- setup/omada-install.sh | 15 ++++++++++++--- setup/openhab-install.sh | 9 +++++++++ setup/photoprism-install.sh | 9 +++++++++ setup/pihole-install.sh | 13 +++++++++++-- setup/plex-install.sh | 13 +++++++++++-- setup/podman-homeassistant-install.sh | 13 +++++++++++-- setup/postgresql-install.sh | 9 +++++++++ setup/prometheus-install.sh | 9 +++++++++ setup/technitiumdns-install.sh | 13 +++++++++++-- setup/unifi-install.sh | 13 +++++++++++-- setup/uptimekuma-install.sh | 13 +++++++++++-- setup/vaultwarden-install.sh | 13 +++++++++++-- setup/whoogle-install.sh | 9 +++++++++ setup/wikijs-install.sh | 9 +++++++++ setup/wireguard-install.sh | 13 +++++++++++-- setup/zigbee2mqtt-install.sh | 13 +++++++++++-- setup/zwavejs2mqtt-install.sh | 13 +++++++++++-- 42 files changed, 443 insertions(+), 65 deletions(-) diff --git a/setup/adguard-install.sh b/setup/adguard-install.sh index ba2c520b..61be5518 100644 --- a/setup/adguard-install.sh +++ b/setup/adguard-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/daemonsync-install.sh b/setup/daemonsync-install.sh index cd41862b..35957afc 100644 --- a/setup/daemonsync-install.sh +++ b/setup/daemonsync-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/dashy-install.sh b/setup/dashy-install.sh index 3a5746e9..8267f380 100644 --- a/setup/dashy-install.sh +++ b/setup/dashy-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/deconz-install.sh b/setup/deconz-install.sh index 643e818e..1cb64ebb 100644 --- a/setup/deconz-install.sh +++ b/setup/deconz-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/docker-install.sh b/setup/docker-install.sh index 8c65c7f5..1780dcfd 100644 --- a/setup/docker-install.sh +++ b/setup/docker-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/emby-install.sh b/setup/emby-install.sh index 63305ab4..0ba9b200 100644 --- a/setup/emby-install.sh +++ b/setup/emby-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/esphome-install.sh b/setup/esphome-install.sh index ffb1ff5b..1f4323be 100644 --- a/setup/esphome-install.sh +++ b/setup/esphome-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/grafana-install.sh b/setup/grafana-install.sh index b1dbe1c8..9803f66a 100644 --- a/setup/grafana-install.sh +++ b/setup/grafana-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/grocy-install.sh b/setup/grocy-install.sh index 7910ce7c..66317825 100644 --- a/setup/grocy-install.sh +++ b/setup/grocy-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/heimdalldashboard-install.sh b/setup/heimdalldashboard-install.sh index 1420ca67..c70347a4 100644 --- a/setup/heimdalldashboard-install.sh +++ b/setup/heimdalldashboard-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/homeassistant-install.sh b/setup/homeassistant-install.sh index fe4c60fd..80e53aba 100644 --- a/setup/homeassistant-install.sh +++ b/setup/homeassistant-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/homebridge-install.sh b/setup/homebridge-install.sh index eae42a0e..8678c607 100644 --- a/setup/homebridge-install.sh +++ b/setup/homebridge-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/influxdb-install.sh b/setup/influxdb-install.sh index 5f4fd34e..6495809f 100644 --- a/setup/influxdb-install.sh +++ b/setup/influxdb-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/iobroker-install.sh b/setup/iobroker-install.sh index 05bbfd36..7ba4a65f 100644 --- a/setup/iobroker-install.sh +++ b/setup/iobroker-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/jellyfin-install.sh b/setup/jellyfin-install.sh index d61151a5..d0a32cd4 100644 --- a/setup/jellyfin-install.sh +++ b/setup/jellyfin-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/keycloak-install.sh b/setup/keycloak-install.sh index 7d155d9f..06c679f6 100644 --- a/setup/keycloak-install.sh +++ b/setup/keycloak-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/magicmirror-install.sh b/setup/magicmirror-install.sh index 0e80fb54..0c903cd2 100644 --- a/setup/magicmirror-install.sh +++ b/setup/magicmirror-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/mariadb-install.sh b/setup/mariadb-install.sh index a8e6b69b..c9025669 100644 --- a/setup/mariadb-install.sh +++ b/setup/mariadb-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/meshcentral-install.sh b/setup/meshcentral-install.sh index bdeb64b2..0221f817 100644 --- a/setup/meshcentral-install.sh +++ b/setup/meshcentral-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/motioneye-install.sh b/setup/motioneye-install.sh index a47c3841..2229ac30 100644 --- a/setup/motioneye-install.sh +++ b/setup/motioneye-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/mqtt-install.sh b/setup/mqtt-install.sh index 6bfc4f04..ade1c168 100644 --- a/setup/mqtt-install.sh +++ b/setup/mqtt-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/n8n-install.sh b/setup/n8n-install.sh index 282f6c6e..9adffc10 100644 --- a/setup/n8n-install.sh +++ b/setup/n8n-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/nginx-proxy-manager-install.sh b/setup/nginx-proxy-manager-install.sh index b2d01b5c..2f9b21b0 100644 --- a/setup/nginx-proxy-manager-install.sh +++ b/setup/nginx-proxy-manager-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/nocodb-install.sh b/setup/nocodb-install.sh index ee32e987..ae27d97c 100644 --- a/setup/nocodb-install.sh +++ b/setup/nocodb-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/node-red-install.sh b/setup/node-red-install.sh index f09cbc92..180daf92 100644 --- a/setup/node-red-install.sh +++ b/setup/node-red-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/omada-install.sh b/setup/omada-install.sh index c65a4104..4260e995 100644 --- a/setup/omada-install.sh +++ b/setup/omada-install.sh @@ -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" diff --git a/setup/openhab-install.sh b/setup/openhab-install.sh index 3fa1e64b..4ec66d79 100644 --- a/setup/openhab-install.sh +++ b/setup/openhab-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/photoprism-install.sh b/setup/photoprism-install.sh index b703e80a..aa692945 100644 --- a/setup/photoprism-install.sh +++ b/setup/photoprism-install.sh @@ -39,6 +39,11 @@ 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 @@ -55,6 +60,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/pihole-install.sh b/setup/pihole-install.sh index 6ac189ad..c27e7ea4 100644 --- a/setup/pihole-install.sh +++ b/setup/pihole-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/plex-install.sh b/setup/plex-install.sh index 1b2d091c..be02e9a4 100644 --- a/setup/plex-install.sh +++ b/setup/plex-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/podman-homeassistant-install.sh b/setup/podman-homeassistant-install.sh index 9f23fc47..c5d9b23f 100644 --- a/setup/podman-homeassistant-install.sh +++ b/setup/podman-homeassistant-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/postgresql-install.sh b/setup/postgresql-install.sh index a37609b2..175011f8 100644 --- a/setup/postgresql-install.sh +++ b/setup/postgresql-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/prometheus-install.sh b/setup/prometheus-install.sh index 5c0cfc1e..2da05e62 100644 --- a/setup/prometheus-install.sh +++ b/setup/prometheus-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/technitiumdns-install.sh b/setup/technitiumdns-install.sh index 9755d9e3..48650070 100644 --- a/setup/technitiumdns-install.sh +++ b/setup/technitiumdns-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/unifi-install.sh b/setup/unifi-install.sh index 0d1cecc3..8e899809 100644 --- a/setup/unifi-install.sh +++ b/setup/unifi-install.sh @@ -39,22 +39,31 @@ 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)" +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 diff --git a/setup/uptimekuma-install.sh b/setup/uptimekuma-install.sh index 2e90fb3c..b29954f1 100644 --- a/setup/uptimekuma-install.sh +++ b/setup/uptimekuma-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/vaultwarden-install.sh b/setup/vaultwarden-install.sh index 699cdd4a..3f18807a 100644 --- a/setup/vaultwarden-install.sh +++ b/setup/vaultwarden-install.sh @@ -38,6 +38,11 @@ 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 @@ -47,13 +52,17 @@ while [ "$(hostname -I)" = "" ]; do ((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 "Setup Container OS" +msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/whoogle-install.sh b/setup/whoogle-install.sh index dd79d68d..e7854c82 100644 --- a/setup/whoogle-install.sh +++ b/setup/whoogle-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/wikijs-install.sh b/setup/wikijs-install.sh index a1bb4882..8866f812 100644 --- a/setup/wikijs-install.sh +++ b/setup/wikijs-install.sh @@ -38,6 +38,11 @@ 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 @@ -54,6 +59,10 @@ done msg_ok "Set up Container OS" 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"; 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 diff --git a/setup/wireguard-install.sh b/setup/wireguard-install.sh index 1a0476e3..d295d4db 100644 --- a/setup/wireguard-install.sh +++ b/setup/wireguard-install.sh @@ -38,22 +38,31 @@ 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)" +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; + OPTIONS_PATH='/options.conf' cat >$OPTIONS_PATH <<'EOF' IPv4dev=eth0 diff --git a/setup/zigbee2mqtt-install.sh b/setup/zigbee2mqtt-install.sh index 2b109303..910da0fe 100644 --- a/setup/zigbee2mqtt-install.sh +++ b/setup/zigbee2mqtt-install.sh @@ -38,22 +38,31 @@ 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)" +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 diff --git a/setup/zwavejs2mqtt-install.sh b/setup/zwavejs2mqtt-install.sh index c1fa407c..c439b9c8 100644 --- a/setup/zwavejs2mqtt-install.sh +++ b/setup/zwavejs2mqtt-install.sh @@ -38,22 +38,31 @@ 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)" +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