13 lines
162 B
Bash
13 lines
162 B
Bash
#!/usr/bin/env bash
|
|
set +e
|
|
COUNT=0
|
|
while [ "$COUNT" -le "$2" ]; do
|
|
ps -u "$1"
|
|
if [ "$?" != "0" ]; then
|
|
exit 0
|
|
fi
|
|
sleep 1
|
|
COUNT=$(($COUNT + 1))
|
|
done
|
|
exit 1
|