From bd099af12f4bb1e067e5edf637361b764d1e714f Mon Sep 17 00:00:00 2001 From: DrMaxNix Date: Mon, 2 Sep 2024 21:53:44 +0200 Subject: [PATCH] :goal_net: catch file disappearing right before reading --- entrypoint.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/entrypoint.sh b/entrypoint.sh index db44b53..8012d41 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -53,7 +53,8 @@ proc_running(){ # try reading state local state_path="/proc/$1/stat" [[ ! -f "$state_path" ]] && return 1 - local state=$(cat "$state_path" | cut -d ' ' -f3) + local state + state=$(cat "$state_path" 2> /dev/null | cut -d ' ' -f3) || return 1 # parse state case "$state" in