🥅 catch file disappearing right before reading
This commit is contained in:
parent
c794049d19
commit
bd099af12f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user