Skip to content

Commit

Permalink
[FIX] Fix execute ps for alpine and BusyBox
Browse files Browse the repository at this point in the history
Signed-off-by: poyaz <pooya_azarpour@yahoo.com>
  • Loading branch information
poyaz committed Apr 11, 2024
1 parent 1fc3b16 commit ad78959
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion clean.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ pidfile_exists() {
}

pid_alive() {
xargs ps -p >/dev/null < "${1}"
if ps --help 2>&1 | grep -q BusyBox; then
xargs ps p >/dev/null < "${1}"
else
xargs ps -p >/dev/null < "${1}"
fi

return $?
}

Expand Down

0 comments on commit ad78959

Please sign in to comment.