From e24ed85fa9f1e94439f0291a457dd39d031dfec5 Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 31 Oct 2024 15:16:25 +0100 Subject: [PATCH] Use named `tmux` session --- scripts/Common/Scripts/wait-network.fish | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/Common/Scripts/wait-network.fish b/scripts/Common/Scripts/wait-network.fish index 04fc196c..462b513d 100755 --- a/scripts/Common/Scripts/wait-network.fish +++ b/scripts/Common/Scripts/wait-network.fish @@ -11,7 +11,7 @@ function waitNetwork -a witness if [ -z "$witness" ] if not testNetwork &>/dev/null - tmux new-session -d 'cat /etc/motd; echo "$(tput bold)Please establish an internet connection...$(tput sgr0)"; $SHELL' + tmux new-session -s network -d 'cat /etc/motd; echo "$(tput bold)Please establish an internet connection...$(tput sgr0)"; $SHELL' fish (status filename) true & set -l pid "$last_pid" @@ -23,7 +23,7 @@ function waitNetwork -a witness end end - tmux attach + tmux attach -t network wait "$pid" return "$(cat "$codeFile")" end @@ -34,13 +34,13 @@ function waitNetwork -a witness set x (math $x + 1) if testNetwork &>/dev/null - tmux kill-session &>/dev/null + tmux kill-session -t network &>/dev/null break else - not tmux list-sessions &>/dev/null + not tmux list-sessions -f "#{==:#S,network}" &>/dev/null or test "$x" -gt 10 and begin - tmux kill-session &>/dev/null + tmux kill-session -t network &>/dev/null exit 1 end end