From 15c6c046aba1c1a94f8686410c55d3fc4e476ccc Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 8 Feb 2023 03:59:42 -0500 Subject: [PATCH] Update paperless-ngx-v5-install.sh correct missing network retries --- install/paperless-ngx-v5-install.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/install/paperless-ngx-v5-install.sh b/install/paperless-ngx-v5-install.sh index 48ed0e08..10a752ce 100644 --- a/install/paperless-ngx-v5-install.sh +++ b/install/paperless-ngx-v5-install.sh @@ -47,15 +47,18 @@ function msg_error() { msg_info "Setting up Container OS " sed -i "/$LANG/ s/\(^# \)//" /etc/locale.gen locale-gen >/dev/null -while [ "$(hostname -I)" = "" ]; do - echo 1>&2 -en "${CROSS}${RD} No Network! " - sleep $RETRY_EVERY - ((NUM--)) - if [ $NUM -eq 0 ]; then - echo 1>&2 -e "${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}" - exit 1 - fi +for ((i=RETRY_NUM; i>0; i--)); do + if [ "$(hostname -I)" != "" ]; then + break + fi + echo 1>&2 -en "${CROSS}${RD} No Network! " + sleep $RETRY_EVERY done +if [ "$(hostname -I)" = "" ]; then + echo 1>&2 -e "\n${CROSS}${RD} No Network After $RETRY_NUM Tries${CL}" + echo -e " 🖧 Check Network Settings" + exit 1 +fi msg_ok "Set up Container OS" msg_ok "Network Connected: ${BL}$(hostname -I)"