diff --git a/scripts/Common/Scripts/wait-network.fish b/scripts/Common/Scripts/wait-network.fish index c1cbb9a5..63d90655 100644 --- a/scripts/Common/Scripts/wait-network.fish +++ b/scripts/Common/Scripts/wait-network.fish @@ -3,8 +3,14 @@ function waitNetwork -a witness set -l timeout (math 10 \* 60) set -l codeFile (mktemp) + function testNetwork + # Ping digitalcourage DNS server + # https://digitalcourage.de/ + ping -q -c1 5.9.164.112 > /dev/null + end + if [ -z "$witness" ] - if not systemctl --quiet is-active network-online.target + if not testNetwork tmux new-session -d 'cat /etc/motd; echo "$(tput bold)Please establish an internet connection…$(tput sgr0)"; $SHELL' fish (status filename) true & set -l pid "$last_pid" @@ -27,7 +33,7 @@ function waitNetwork -a witness while true set x (math $x + 1) - if systemctl --quiet is-active network-online.target + if testNetwork tmux kill-session &> /dev/null break else