From 342e62e2a656ee5c3a80e203714a15a9b744b5aa Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Tue, 1 Aug 2023 19:27:34 +0200 Subject: [PATCH] add progressbar to network --- usr/bin/archboot-network.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr/bin/archboot-network.sh b/usr/bin/archboot-network.sh index c3ae0f317..c615b5f46 100755 --- a/usr/bin/archboot-network.sh +++ b/usr/bin/archboot-network.sh @@ -197,20 +197,20 @@ _network() { echo "Using setup's network profile ${_NETWORK_PROFILE} now..." >"${_LOG}" systemctl restart systemd-networkd systemctl restart systemd-resolved - _dialog --no-mouse --infobox "Waiting for network link to come up..." 3 50 # add sleep here for systemd-resolve get correct values _COUNT=0 while true; do sleep 1 if getent hosts www.google.com &>"${_LOG}"; then - _dialog --no-mouse --infobox "Network configuration completed successfully." 3 50 + _progress "100" "Network configuration completed successfully." sleep 2 return 0 fi _COUNT=$((_COUNT+1)) # abort after 10 seconds + _progress "$((${_COUNT}*10))" "Waiting $((10-${_COUNT})) seconds for network link to come up..." [[ "${_COUNT}" == 10 ]] && break - done + done | _dialog --no-mouse --gauge "Waiting 10 seconds for network link to come up..." 6 60 0 if ! getent hosts www.google.com &>"${_LOG}"; then _dialog --title " ERROR " --no-mouse --infobox "Your network is not working correctly, please configure again!" 3 60 sleep 3