From 9da2c365a67c09e6585081858bf99f3218ac3067 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:45:40 -0500 Subject: [PATCH 01/15] Update adguard_setup.sh --- setup/adguard_setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup/adguard_setup.sh b/setup/adguard_setup.sh index 71302ded..1dad9b95 100644 --- a/setup/adguard_setup.sh +++ b/setup/adguard_setup.sh @@ -6,6 +6,11 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' +CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -25,6 +30,17 @@ function msg() { msg "Setting up Container OS..." sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" msg "Updating Container OS..." apt update &>/dev/null From 31c84f6309e7c5268f85c28020985f8de4f63ab5 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:46:45 -0500 Subject: [PATCH 02/15] Update debian11_setup.sh --- setup/debian11_setup.sh | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/setup/debian11_setup.sh b/setup/debian11_setup.sh index 142ca428..5b2c1f0b 100644 --- a/setup/debian11_setup.sh +++ b/setup/debian11_setup.sh @@ -7,8 +7,11 @@ set -o nounset #Treat unset variables as an error set -o pipefail #Pipe will exit with last non-zero status if applicable shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' -CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' +CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -28,12 +31,17 @@ function msg() { msg "Setting up container OS..." sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null -sleep 3 while [ "$(hostname -I)" = "" ]; do - echo -e "${CROSS} \e[1;31m No network: \e[0m $(date)" - sleep 3 + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi done - echo -e "${CHECKMARK} \e[1;92m Network connected: \e[0m $(hostname -I)" + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" msg "Updating container OS..." apt update &>/dev/null From 97453e259fc2f9b883837701de76f94a5fb12026 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:47:36 -0500 Subject: [PATCH 03/15] Update esphome_setup.sh --- setup/esphome_setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup/esphome_setup.sh b/setup/esphome_setup.sh index 520bf7ca..d2205781 100644 --- a/setup/esphome_setup.sh +++ b/setup/esphome_setup.sh @@ -7,6 +7,11 @@ set -o nounset #Treat unset variables as an error set -o pipefail #Pipe will exit with last non-zero status if applicable shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' +CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -27,6 +32,17 @@ function msg() { msg "Setting up Container OS..." sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" # Update container OS msg "Updating container OS..." From 1b9a9e4de0a16cbfcded92bee8b723fbff760c94 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:48:36 -0500 Subject: [PATCH 04/15] Update ha_setup.sh --- setup/ha_setup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup/ha_setup.sh b/setup/ha_setup.sh index 5b74959b..ee37eadd 100644 --- a/setup/ha_setup.sh +++ b/setup/ha_setup.sh @@ -6,7 +6,11 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -26,6 +30,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null From 39735325109d71fcd09a3b6c8ad266843af1c79b Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:50:02 -0500 Subject: [PATCH 05/15] Update jellyfin_setup.sh --- setup/jellyfin_setup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup/jellyfin_setup.sh b/setup/jellyfin_setup.sh index 8d09ff0d..2e50aa89 100644 --- a/setup/jellyfin_setup.sh +++ b/setup/jellyfin_setup.sh @@ -7,7 +7,11 @@ set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' trap die ERR +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap 'die "Script interrupted."' INT function error_exit() { @@ -26,6 +30,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null From 57388a3e171877407de95d0c7eae34bf618e7f95 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:50:56 -0500 Subject: [PATCH 06/15] Update mariadb_setup.sh --- setup/mariadb_setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup/mariadb_setup.sh b/setup/mariadb_setup.sh index 5df2827c..bbfd9615 100644 --- a/setup/mariadb_setup.sh +++ b/setup/mariadb_setup.sh @@ -7,6 +7,11 @@ set -o nounset #Treat unset variables as an error set -o pipefail #Pipe will exit with last non-zero status if applicable shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' +CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -27,6 +32,17 @@ function msg() { msg "Setting up container OS..." sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" # Update container OS msg "Updating container OS..." From 56659bf1118c244c1e7b84562c3cde9a811389d0 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:51:52 -0500 Subject: [PATCH 07/15] Update mqtt_setup.sh --- setup/mqtt_setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup/mqtt_setup.sh b/setup/mqtt_setup.sh index ab57741e..84008ea8 100644 --- a/setup/mqtt_setup.sh +++ b/setup/mqtt_setup.sh @@ -7,6 +7,11 @@ set -o nounset #Treat unset variables as an error set -o pipefail #Pipe will exit with last non-zero status if applicable shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' +CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -27,6 +32,17 @@ function msg() { msg "Setting up Container OS..." sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" # Update container OS msg "Updating Container OS..." From 6701d6d276b882520a744cb1b6a172efa00bb4b7 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:52:45 -0500 Subject: [PATCH 08/15] Update node-red_setup.sh --- setup/node-red_setup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup/node-red_setup.sh b/setup/node-red_setup.sh index 5f3c0cbd..c0c5b1ec 100644 --- a/setup/node-red_setup.sh +++ b/setup/node-red_setup.sh @@ -6,7 +6,11 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -26,6 +30,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null From c6396b8b46495703b85fc2be6d8825e336b34d5c Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:53:57 -0500 Subject: [PATCH 09/15] Update npm_setup.sh --- setup/npm_setup.sh | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/setup/npm_setup.sh b/setup/npm_setup.sh index 74bd42f1..16838fee 100644 --- a/setup/npm_setup.sh +++ b/setup/npm_setup.sh @@ -6,8 +6,11 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' -CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' +CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -26,12 +29,18 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null -sleep 3 while [ "$(hostname -I)" = "" ]; do - echo -e "${CROSS} \e[1;31m No network: \e[0m $(date)" - sleep 3 + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi done - echo -e "${CHECKMARK} \e[1;92m Network connected: \e[0m $(hostname -I)" + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" + echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null apt-get -qqy upgrade &>/dev/null From 2a0df9c7b03390fd55a8fa95905bfdf15895b444 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:54:48 -0500 Subject: [PATCH 10/15] Update pihole_setup.sh --- setup/pihole_setup.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/setup/pihole_setup.sh b/setup/pihole_setup.sh index fcee1e0d..09f809b5 100644 --- a/setup/pihole_setup.sh +++ b/setup/pihole_setup.sh @@ -6,6 +6,11 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' +CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -25,6 +30,17 @@ function msg() { msg "Setting up LXC OS..." sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" # Update container OS msg "Updating container OS..." From 7bb2eb3caea358213461d5d6bf99b011cd688098 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:55:48 -0500 Subject: [PATCH 11/15] Update plex_setup.sh --- setup/plex_setup.sh | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/setup/plex_setup.sh b/setup/plex_setup.sh index b2c31c74..50fcc1ad 100644 --- a/setup/plex_setup.sh +++ b/setup/plex_setup.sh @@ -6,8 +6,12 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' -trap die ERR +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM +trap die ERR trap 'die "Script interrupted."' INT function error_exit() { @@ -26,6 +30,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null From e606148bad255628b67dac0c34dbd7b8e52109d9 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:56:42 -0500 Subject: [PATCH 12/15] Update podman_ha_setup.sh --- setup/podman_ha_setup.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/setup/podman_ha_setup.sh b/setup/podman_ha_setup.sh index 9b9e7953..e74c1238 100644 --- a/setup/podman_ha_setup.sh +++ b/setup/podman_ha_setup.sh @@ -6,7 +6,10 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 trap die ERR trap 'die "Script interrupted."' INT @@ -26,6 +29,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null From b54ca7c8cce8871a3c432bbc946775a2aba40618 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:57:42 -0500 Subject: [PATCH 13/15] Update ubuntu_setup.sh --- setup/ubuntu_setup.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/setup/ubuntu_setup.sh b/setup/ubuntu_setup.sh index dc6db27d..b35e5027 100644 --- a/setup/ubuntu_setup.sh +++ b/setup/ubuntu_setup.sh @@ -6,7 +6,10 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 trap die ERR trap 'die "Script interrupted."' INT @@ -26,6 +29,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS \e[0m" apt update &>/dev/null From bae1e831d9269ebb70e641553dc8e319360f4e6f Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:58:39 -0500 Subject: [PATCH 14/15] Update zigbee2mqtt_setup.sh --- setup/zigbee2mqtt_setup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup/zigbee2mqtt_setup.sh b/setup/zigbee2mqtt_setup.sh index dbee2ca7..6dd0aea7 100644 --- a/setup/zigbee2mqtt_setup.sh +++ b/setup/zigbee2mqtt_setup.sh @@ -6,7 +6,11 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -26,6 +30,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null From 7a32aa00c4049432ce79a1e878070134bc792491 Mon Sep 17 00:00:00 2001 From: tteckster Date: Tue, 1 Feb 2022 21:59:29 -0500 Subject: [PATCH 15/15] Update zwavejs2mqtt_setup.sh --- setup/zwavejs2mqtt_setup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup/zwavejs2mqtt_setup.sh b/setup/zwavejs2mqtt_setup.sh index 49dcfce8..228e1c73 100644 --- a/setup/zwavejs2mqtt_setup.sh +++ b/setup/zwavejs2mqtt_setup.sh @@ -6,7 +6,11 @@ set -o nounset set -o pipefail shopt -s expand_aliases alias die='EXIT=$? LINE=$LINENO error_exit' +CROSS='\033[1;31m\xE2\x9D\x8C\033[0m' CHECKMARK='\033[0;32m\xE2\x9C\x94\033[0m' +RETRY_NUM=5 +RETRY_EVERY=3 +NUM=$RETRY_NUM trap die ERR trap 'die "Script interrupted."' INT @@ -26,6 +30,17 @@ function msg() { echo -e "${CHECKMARK} \e[1;92m Setting up Container OS... \e[0m" sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null +while [ "$(hostname -I)" = "" ]; do + 1>&2 echo -e "${CROSS} \e[1;31m No Network: \e[0m $(date)" + sleep $RETRY_EVERY + ((NUM--)) + if [ $NUM -eq 0 ] + then + 1>&2 echo -e "${CROSS} \e[1;31m No Network After $RETRY_NUM Tries \e[0m" + exit 1 + fi +done + echo -e "${CHECKMARK} \e[1;92m Network Connected: \e[0m $(hostname -I)" echo -e "${CHECKMARK} \e[1;92m Updating Container OS... \e[0m" apt update &>/dev/null